@@ -639,8 +639,8 @@ func (r *NamespaceScopeReconciler) RestartPods(labels map[string]string, cm *cor
639
639
continue
640
640
}
641
641
// Delete operator pod to refresh it
642
- podLabels := pod .GetLabels ()
643
- _ , ok := podLabels ["olm.operatorGroup" ]
642
+ podAnno := pod .GetAnnotations ()
643
+ _ , ok := podAnno ["olm.operatorGroup" ]
644
644
if ok {
645
645
if err := r .Client .Delete (ctx , & pod ); err != nil {
646
646
klog .Errorf ("Failed to delete pods %s in namespace %s: %v" , pod .Name , pod .Namespace , err )
@@ -678,12 +678,11 @@ func (r *NamespaceScopeReconciler) RestartPods(labels map[string]string, cm *cor
678
678
klog .Errorf ("Failed to get deployment %s in namespace %s: %v" , deploymentName , namespace , err )
679
679
return err
680
680
}
681
- originalDeploy := deploy
682
681
if deploy .Spec .Template .Annotations == nil {
683
682
deploy .Spec .Template .Annotations = make (map [string ]string )
684
683
}
685
684
deploy .Spec .Template .Annotations ["nss.ibm.com/namespaceList" ] = annotationValue
686
- if err := r .Patch (ctx , deploy , client . MergeFrom ( originalDeploy ) ); err != nil {
685
+ if err := r .Update (ctx , deploy ); err != nil {
687
686
klog .Errorf ("Failed to update the annotation of the deployment %s in namespace %s: %v" , deploymentName , namespace , err )
688
687
return err
689
688
}
0 commit comments