From d74b06433d278613541cb7fe676a266cb5fbd147 Mon Sep 17 00:00:00 2001 From: "lan.tian" Date: Wed, 7 Feb 2024 12:46:49 +0800 Subject: [PATCH 1/2] Ignore the operatorConfig.ObjectMeta.Generation when only updating theoperatorConfig.operatorloglevel, the operatorConfig.ObjectMeta.Generation will change, but this time we should not rollout the operand as the operand loglevel, the observedConfig, and the unsupportedConfigOverrides has not changed at all Signed-off-by: lan.tian --- pkg/operator/sync_openshiftcontrollermanager_v311_00.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/operator/sync_openshiftcontrollermanager_v311_00.go b/pkg/operator/sync_openshiftcontrollermanager_v311_00.go index 68e2b5b64..75fdf7ed5 100644 --- a/pkg/operator/sync_openshiftcontrollermanager_v311_00.go +++ b/pkg/operator/sync_openshiftcontrollermanager_v311_00.go @@ -60,13 +60,9 @@ func syncOpenShiftControllerManager_v311_00_to_latest( operandName := "openshift-controller-manager" rcOperandName := "route-controller-manager" - specAnnotations := map[string]string{ - "openshiftcontrollermanagers.operator.openshift.io/cluster": strconv.FormatInt(operatorConfig.ObjectMeta.Generation, 10), - } + specAnnotations := map[string]string{} - rcSpecAnnotations := map[string]string{ - "openshiftcontrollermanagers.operator.openshift.io/cluster": strconv.FormatInt(operatorConfig.ObjectMeta.Generation, 10), - } + rcSpecAnnotations := map[string]string{} // OpenShift Controller Manager configMap, _, err := manageOpenShiftControllerManagerConfigMap_v311_00_to_latest(c.clusterVersionLister, c.kubeClient, c.configMapsGetter, c.recorder, operatorConfig) From fe6db74e6868c8a1d4283a848261fbcde7f2df4a Mon Sep 17 00:00:00 2001 From: "lan.tian" Date: Wed, 7 Feb 2024 12:49:16 +0800 Subject: [PATCH 2/2] update context Signed-off-by: lan.tian --- pkg/operator/generic_client.go | 4 ++-- pkg/operator/sync_openshiftcontrollermanager_v311_00.go | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/operator/generic_client.go b/pkg/operator/generic_client.go index b4abdbf09..423a88912 100644 --- a/pkg/operator/generic_client.go +++ b/pkg/operator/generic_client.go @@ -64,7 +64,7 @@ func (p *genericClient) UpdateOperatorSpec(ctx context.Context, resourceVersion resourceCopy.ResourceVersion = resourceVersion resourceCopy.Spec.OperatorSpec = *spec - ret, err := p.client.OpenShiftControllerManagers().Update(context.TODO(), resourceCopy, metav1.UpdateOptions{}) + ret, err := p.client.OpenShiftControllerManagers().Update(ctx, resourceCopy, metav1.UpdateOptions{}) if err != nil { return nil, "", err } @@ -80,7 +80,7 @@ func (p *genericClient) UpdateOperatorStatus(ctx context.Context, resourceVersio resourceCopy.ResourceVersion = resourceVersion resourceCopy.Status.OperatorStatus = *status - ret, err := p.client.OpenShiftControllerManagers().UpdateStatus(context.TODO(), resourceCopy, metav1.UpdateOptions{}) + ret, err := p.client.OpenShiftControllerManagers().UpdateStatus(ctx, resourceCopy, metav1.UpdateOptions{}) if err != nil { return nil, err } diff --git a/pkg/operator/sync_openshiftcontrollermanager_v311_00.go b/pkg/operator/sync_openshiftcontrollermanager_v311_00.go index 75fdf7ed5..efce72f6c 100644 --- a/pkg/operator/sync_openshiftcontrollermanager_v311_00.go +++ b/pkg/operator/sync_openshiftcontrollermanager_v311_00.go @@ -6,7 +6,6 @@ import ( "fmt" "os" "sort" - "strconv" "strings" "github.com/openshift/cluster-openshift-controller-manager-operator/bindata"