File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
cmd/kube-controller-manager/app Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ go_library(
109
109
"//pkg/volume/util:go_default_library" ,
110
110
"//pkg/volume/vsphere_volume:go_default_library" ,
111
111
"//staging/src/k8s.io/api/core/v1:go_default_library" ,
112
+ "//staging/src/k8s.io/api/discovery/v1beta1:go_default_library" ,
112
113
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library" ,
113
114
"//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library" ,
114
115
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library" ,
Original file line number Diff line number Diff line change @@ -23,10 +23,24 @@ package app
23
23
import (
24
24
"net/http"
25
25
26
+ discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
27
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
28
+ "k8s.io/klog"
26
29
endpointslicecontroller "k8s.io/kubernetes/pkg/controller/endpointslice"
30
+ "k8s.io/kubernetes/pkg/features"
27
31
)
28
32
29
33
func startEndpointSliceController (ctx ControllerContext ) (http.Handler , bool , error ) {
34
+ if ! utilfeature .DefaultFeatureGate .Enabled (features .EndpointSlice ) {
35
+ klog .V (4 ).Infof ("Not starting endpointslice-controller since EndpointSlice feature gate is disabled" )
36
+ return nil , false , nil
37
+ }
38
+
39
+ if ! ctx .AvailableResources [discoveryv1beta1 .SchemeGroupVersion .WithResource ("endpointslices" )] {
40
+ klog .Warningf ("Not starting endpointslice-controller since discovery.k8s.io/v1beta1 resources are not available" )
41
+ return nil , false , nil
42
+ }
43
+
30
44
go endpointslicecontroller .NewController (
31
45
ctx .InformerFactory .Core ().V1 ().Pods (),
32
46
ctx .InformerFactory .Core ().V1 ().Services (),
You can’t perform that action at this time.
0 commit comments