mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
genericapiserver: turn APIContainer.SecretRoutes into a real ServeMux
This commit is contained in:
parent
cbbe421db8
commit
df7e711c0a
@ -29,8 +29,12 @@ import (
|
|||||||
// handlers that do not show up in swagger or in /
|
// handlers that do not show up in swagger or in /
|
||||||
type APIContainer struct {
|
type APIContainer struct {
|
||||||
*restful.Container
|
*restful.Container
|
||||||
|
|
||||||
|
// NonSwaggerRoutes are recorded and are visible at /, but do not show up in Swagger.
|
||||||
NonSwaggerRoutes PathRecorderMux
|
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
|
// NewAPIContainer constructs a new container for APIs
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
func TestNewAPIContainer(t *testing.T) {
|
func TestNewAPIContainer(t *testing.T) {
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
c := NewAPIContainer(mux, nil)
|
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")
|
assert.Equal(t, mux, c.Container.ServeMux, "Container ServeMux's do not match")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user