Skip to content

Commit

Permalink
feat: add annotations to operator (#1914)
Browse files Browse the repository at this point in the history
add annotations to operator
  • Loading branch information
jiuker committed Dec 18, 2023
1 parent 3873db7 commit bb43a3e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/controller/main-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit bb43a3e

Please sign in to comment.