Skip to content

Commit 29d24f4

Browse files
kylapeopenshift-cherrypick-robot
authored and
openshift-cherrypick-robot
committed
Don't add /clusters/ prefix to /services/ requests
Currently all requests from bound service accounts get `/clusters/` prepended to the path in the front proxy with a few exeptions. None of those exceptions are for `/services/` requests. With `/services/` requests prepended with `/clusters/`, the front proxy will then route them to the KCP container instead of the virtual workspace server. KCP will remove the `/clusters/` prefix, create the logical cluster context, and then try to redirect the `/services/` request to the virtual workspace server. Rinse and repeat until the client gives up. This fix is to stop prepending `/clusters/` on requests to the virtual workspace server.
1 parent fe430c8 commit 29d24f4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/server/handler.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ func WithInClusterServiceAccountRequestRewrite(handler http.Handler) http.Handle
280280
return
281281
}
282282

283+
if strings.HasPrefix(req.RequestURI, "/services/") {
284+
handler.ServeHTTP(w, req)
285+
return
286+
}
287+
283288
prefix := "Bearer "
284289
token := req.Header.Get("Authorization")
285290
if !strings.HasPrefix(token, prefix) {

0 commit comments

Comments
 (0)