@@ -48,6 +48,7 @@ const (
4848type TargetConfigController struct {
4949 targetImagePullSpec string
5050 operatorImagePullSpec string
51+ operatorImageVersion string
5152
5253 operatorClient v1helpers.StaticPodOperatorClient
5354
@@ -59,7 +60,7 @@ type TargetConfigController struct {
5960}
6061
6162func NewTargetConfigController (
62- targetImagePullSpec , operatorImagePullSpec string ,
63+ targetImagePullSpec , operatorImagePullSpec , operatorImageVersion string ,
6364 operatorClient v1helpers.StaticPodOperatorClient ,
6465 kubeInformersForOpenshiftKubeAPIServerNamespace informers.SharedInformerFactory ,
6566 kubeInformersForNamespaces v1helpers.KubeInformersForNamespaces ,
@@ -71,6 +72,7 @@ func NewTargetConfigController(
7172 c := & TargetConfigController {
7273 targetImagePullSpec : targetImagePullSpec ,
7374 operatorImagePullSpec : operatorImagePullSpec ,
75+ operatorImageVersion : operatorImageVersion ,
7476 operatorClient : operatorClient ,
7577 kubeClient : kubeClient ,
7678 configMapLister : kubeInformersForNamespaces .ConfigMapLister (),
@@ -215,7 +217,7 @@ func createTargetConfig(ctx context.Context, c TargetConfigController, recorder
215217 if err != nil {
216218 errors = append (errors , fmt .Errorf ("%q: %v" , "configmap/config" , err ))
217219 }
218- _ , _ , err = managePods (ctx , c .kubeClient .CoreV1 (), c .isStartupMonitorEnabledFn , recorder , operatorSpec , c .targetImagePullSpec , c .operatorImagePullSpec )
220+ _ , _ , err = managePods (ctx , c .kubeClient .CoreV1 (), c .isStartupMonitorEnabledFn , recorder , operatorSpec , c .targetImagePullSpec , c .operatorImagePullSpec , c . operatorImageVersion )
219221 if err != nil {
220222 errors = append (errors , fmt .Errorf ("%q: %v" , "configmap/kube-apiserver-pod" , err ))
221223 }
@@ -293,8 +295,8 @@ func manageKubeAPIServerConfig(ctx context.Context, client coreclientv1.ConfigMa
293295 return resourceapply .ApplyConfigMap (ctx , client , recorder , requiredConfigMap )
294296}
295297
296- func managePods (ctx context.Context , client coreclientv1.ConfigMapsGetter , isStartupMonitorEnabledFn func () (bool , error ), recorder events.Recorder , operatorSpec * operatorv1.StaticPodOperatorSpec , imagePullSpec , operatorImagePullSpec string ) (* corev1.ConfigMap , bool , error ) {
297- appliedPodTemplate , err := manageTemplate (string (bindata .MustAsset ("assets/kube-apiserver/pod.yaml" )), imagePullSpec , operatorImagePullSpec , operatorSpec )
298+ 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 ) {
299+ appliedPodTemplate , err := manageTemplate (string (bindata .MustAsset ("assets/kube-apiserver/pod.yaml" )), imagePullSpec , operatorImagePullSpec , operatorImageVersion , operatorSpec )
298300 if err != nil {
299301 return nil , false , err
300302 }
@@ -547,6 +549,7 @@ func gogcFromConfig(config map[string]interface{}) (int, error) {
547549type kasTemplate struct {
548550 Image string
549551 OperatorImage string
552+ OperatorImageVersion string
550553 Verbosity string
551554 GracefulTerminationDuration int
552555 SetupContainerTimeoutDuration int
@@ -567,7 +570,7 @@ func effectiveConfiguration(spec *operatorv1.StaticPodOperatorSpec) (map[string]
567570 return effectiveConfig , nil
568571}
569572
570- func manageTemplate (rawTemplate string , imagePullSpec string , operatorImagePullSpec string , operatorSpec * operatorv1.StaticPodOperatorSpec ) (string , error ) {
573+ func manageTemplate (rawTemplate string , imagePullSpec string , operatorImagePullSpec , operatorImageVersion string , operatorSpec * operatorv1.StaticPodOperatorSpec ) (string , error ) {
571574 var verbosity string
572575 switch operatorSpec .LogLevel {
573576 case operatorv1 .Normal :
@@ -600,6 +603,7 @@ func manageTemplate(rawTemplate string, imagePullSpec string, operatorImagePullS
600603 tmplVal := kasTemplate {
601604 Image : imagePullSpec ,
602605 OperatorImage : operatorImagePullSpec ,
606+ OperatorImageVersion : operatorImageVersion ,
603607 Verbosity : verbosity ,
604608 GracefulTerminationDuration : gracefulTerminationDuration ,
605609 // 80s for minimum-termination-duration (10s port wait, 65s to let pending requests finish after port has been freed) + 5s extra cri-o's graceful termination period
0 commit comments