@@ -241,6 +241,10 @@ func createTargetConfig(ctx context.Context, c TargetConfigController, recorder
241
241
if err != nil {
242
242
errors = append (errors , fmt .Errorf ("%q: %v" , "serviceaccount/localhost-recovery-client" , err ))
243
243
}
244
+ _ , _ , err = manageKubeAPICheckEndpointsConfig (ctx , c .kubeClient .CoreV1 (), recorder )
245
+ if err != nil {
246
+ errors = append (errors , fmt .Errorf ("%q: %v" , "configmap/kube-apiserver-check-endpoints-config" , err ))
247
+ }
244
248
245
249
if len (errors ) > 0 {
246
250
condition := operatorv1.OperatorCondition {
@@ -303,6 +307,16 @@ func manageKubeAPIServerConfig(ctx context.Context, client coreclientv1.ConfigMa
303
307
return resourceapply .ApplyConfigMap (ctx , client , recorder , requiredConfigMap )
304
308
}
305
309
310
+ func manageKubeAPICheckEndpointsConfig (ctx context.Context , client coreclientv1.ConfigMapsGetter , recorder events.Recorder ) (* corev1.ConfigMap , bool , error ) {
311
+ configMap := resourceread .ReadConfigMapV1OrDie (bindata .MustAsset ("assets/kube-apiserver/check-endpoints-config-cm.yaml" ))
312
+ cmCLient := client .ConfigMaps (operatorclient .TargetNamespace )
313
+ _ , err := cmCLient .Get (ctx , "kube-apiserver-check-endpoints-config" , metav1.GetOptions {})
314
+ if err != nil && apierrors .IsNotFound (err ){
315
+ return _ , _ , err
316
+ }
317
+ return resourceapply .ApplyConfigMap (ctx , client , recorder , configMap )
318
+ }
319
+
306
320
func managePods (ctx context.Context , client coreclientv1.ConfigMapsGetter , isStartupMonitorEnabledFn func () (bool , error ), recorder events.Recorder , operatorSpec * operatorv1.StaticPodOperatorSpec , imagePullSpec , operatorImagePullSpec , operatorImageVersion string ) (* corev1.ConfigMap , bool , error ) {
307
321
appliedPodTemplate , err := manageTemplate (string (bindata .MustAsset ("assets/kube-apiserver/pod.yaml" )), imagePullSpec , operatorImagePullSpec , operatorImageVersion , operatorSpec )
308
322
if err != nil {
0 commit comments