diff --git a/pkg/controller/main-controller.go b/pkg/controller/main-controller.go index e0fca8f7aaa..d000e65201d 100644 --- a/pkg/controller/main-controller.go +++ b/pkg/controller/main-controller.go @@ -260,6 +260,15 @@ func NewController( } } } + if len(oprImg) > 0 { + imageInfo := strings.Split(oprImg, ":") + if len(imageInfo) == 2 { + _, err = kubeClientSet.AppsV1().Deployments(ns).Patch(ctx, getOperatorDeploymentName(), types.MergePatchType, []byte(`{"metadata":{"annotations":{"min.io/operator":"`+imageInfo[1]+`"}}}`), metav1.PatchOptions{}) + if err != nil { + klog.Errorf("Patch operator deployments annotations['min.io/operator':'%s'] err: %s", imageInfo[1], err) + } + } + } oprImg = env.Get(DefaultOperatorImageEnv, oprImg)