Blob Blame Raw
From 73d74e6e9b886e4de2de24aa5edff248289771fe Mon Sep 17 00:00:00 2001
From: Jan Chaloupka <jchaloup@redhat.com>
Date: Thu, 13 Apr 2017 14:00:10 +0200
Subject: [PATCH] fix rootScopeNaming generate selfLink issue #37686

---
 .../staging/src/k8s.io/apiserver/pkg/endpoints/installer.go          | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go b/src/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go
index c4d26d4..6755720 100644
--- a/src/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go
+++ b/src/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go
@@ -850,7 +850,10 @@ func (n rootScopeNaming) GenerateLink(req *restful.Request, obj runtime.Object)
 			return "", err
 		}
 	}
-	return n.pathPrefix + url.QueryEscape(name) + n.pathSuffix, nil
+	if len(n.pathSuffix) == 0 {
+		return gpath.Join(n.pathPrefix, url.QueryEscape(name)), nil
+	}
+	return gpath.Join(n.pathPrefix, url.QueryEscape(name), n.pathSuffix), nil
 }
 
 // GenerateListLink returns the appropriate path and query to locate a list by its canonical path.
-- 
2.7.4