diff --git a/pkg/genericapiserver/mux/container.go b/pkg/genericapiserver/mux/container.go index 7b25415a1a..801d74afa3 100644 --- a/pkg/genericapiserver/mux/container.go +++ b/pkg/genericapiserver/mux/container.go @@ -29,8 +29,12 @@ import ( // handlers that do not show up in swagger or in / type APIContainer struct { *restful.Container + + // NonSwaggerRoutes are recorded and are visible at /, but do not show up in Swagger. NonSwaggerRoutes PathRecorderMux - SecretRoutes Mux + + // SecretRoutes are not recorded, are not visible at / and do not show up in Swagger. + SecretRoutes *http.ServeMux } // NewAPIContainer constructs a new container for APIs diff --git a/pkg/genericapiserver/mux/container_test.go b/pkg/genericapiserver/mux/container_test.go index c098cf0bb7..43e6a927d7 100644 --- a/pkg/genericapiserver/mux/container_test.go +++ b/pkg/genericapiserver/mux/container_test.go @@ -26,7 +26,7 @@ import ( func TestNewAPIContainer(t *testing.T) { mux := http.NewServeMux() c := NewAPIContainer(mux, nil) - assert.Equal(t, mux, c.SecretRoutes.(*http.ServeMux), "SecretRoutes ServeMux's do not match") + assert.Equal(t, mux, c.SecretRoutes, "SecretRoutes ServeMux's do not match") assert.Equal(t, mux, c.Container.ServeMux, "Container ServeMux's do not match") }