Blame fix-rootScopeNaming-generate-selfLink-issue-37686.patch

b0ef5e
From 73d74e6e9b886e4de2de24aa5edff248289771fe Mon Sep 17 00:00:00 2001
722269
From: Jan Chaloupka <jchaloup@redhat.com>
b0ef5e
Date: Thu, 13 Apr 2017 14:00:10 +0200
722269
Subject: [PATCH] fix rootScopeNaming generate selfLink issue #37686
722269
722269
---
b0ef5e
 .../staging/src/k8s.io/apiserver/pkg/endpoints/installer.go          | 5 ++++-
722269
 1 file changed, 4 insertions(+), 1 deletion(-)
722269
b0ef5e
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
b0ef5e
index c4d26d4..6755720 100644
b0ef5e
--- a/src/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go
b0ef5e
+++ b/src/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go
b0ef5e
@@ -850,7 +850,10 @@ func (n rootScopeNaming) GenerateLink(req *restful.Request, obj runtime.Object)
722269
 			return "", err
722269
 		}
722269
 	}
722269
-	return n.pathPrefix + url.QueryEscape(name) + n.pathSuffix, nil
722269
+	if len(n.pathSuffix) == 0 {
6b0eaf
+		return gpath.Join(n.pathPrefix, url.QueryEscape(name)), nil
722269
+	}
6b0eaf
+	return gpath.Join(n.pathPrefix, url.QueryEscape(name), n.pathSuffix), nil
722269
 }
722269
 
722269
 // GenerateListLink returns the appropriate path and query to locate a list by its canonical path.
722269
-- 
722269
2.7.4
722269