mirror of https://github.com/k3s-io/k3s
genericapiserver: turn APIContainer.SecretRoutes into a real ServeMux
parent
cbbe421db8
commit
df7e711c0a
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue