mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
add aggregated /apis handler for genericapiserver
so that aggregated-apiservers can also take advantage. discovered by e2e tests with feature enabled
This commit is contained in:
parent
1550655336
commit
c9b3488400
@ -35,6 +35,7 @@ import (
|
|||||||
jsonpatch "github.com/evanphx/json-patch"
|
jsonpatch "github.com/evanphx/json-patch"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
"k8s.io/apimachinery/pkg/runtime/serializer"
|
"k8s.io/apimachinery/pkg/runtime/serializer"
|
||||||
@ -931,7 +932,12 @@ func installAPI(s *GenericAPIServer, c *Config) {
|
|||||||
routes.Version{Version: c.Version}.Install(s.Handler.GoRestfulContainer)
|
routes.Version{Version: c.Version}.Install(s.Handler.GoRestfulContainer)
|
||||||
|
|
||||||
if c.EnableDiscovery {
|
if c.EnableDiscovery {
|
||||||
s.Handler.GoRestfulContainer.Add(s.DiscoveryGroupManager.WebService())
|
if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.AggregatedDiscoveryEndpoint) {
|
||||||
|
wrapped := discoveryendpoint.WrapAggregatedDiscoveryToHandler(s.DiscoveryGroupManager, s.AggregatedDiscoveryGroupManager)
|
||||||
|
s.Handler.GoRestfulContainer.Add(wrapped.GenerateWebService("/apis", metav1.APIGroupList{}))
|
||||||
|
} else {
|
||||||
|
s.Handler.GoRestfulContainer.Add(s.DiscoveryGroupManager.WebService())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if c.FlowControl != nil && utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIPriorityAndFairness) {
|
if c.FlowControl != nil && utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIPriorityAndFairness) {
|
||||||
c.FlowControl.Install(s.Handler.NonGoRestfulMux)
|
c.FlowControl.Install(s.Handler.NonGoRestfulMux)
|
||||||
|
Loading…
Reference in New Issue
Block a user