diff --git a/helm/operator/values.yaml b/helm/operator/values.yaml index 38328a133f8..98676c0d097 100644 --- a/helm/operator/values.yaml +++ b/helm/operator/values.yaml @@ -2,15 +2,20 @@ operator: ## Setup environment variables for the Operator - # env: - # - name: MINIO_CONSOLE_TLS_ENABLE - # value: "off" - # - name: CLUSTER_DOMAIN - # value: "cluster.domain" - # - name: WATCHED_NAMESPACE - # value: "" - # - name: MINIO_OPERATOR_RUNTIME - # value: "OpenShift" +# env: +# - name: MINIO_OPERATOR_DEPLOYMENT_NAME +# valueFrom: +# fieldRef: +# fieldPath: metadata.labels['app.kubernetes.io/name'] +# - name: MINIO_CONSOLE_TLS_ENABLE +# value: "off" +# - name: CLUSTER_DOMAIN +# value: "cluster.domain" +# - name: WATCHED_NAMESPACE +# value: "" +# - name: MINIO_OPERATOR_RUNTIME +# value: "OpenShift" + env: [ ] # ### Image field: ## Image from tag (original behaviour), for example: @@ -30,7 +35,6 @@ operator: imagePullSecrets: [ ] runtimeClassName: ~ initContainers: [ ] - env: [ ] replicaCount: 2 securityContext: runAsUser: 1000 diff --git a/pkg/controller/main-controller.go b/pkg/controller/main-controller.go index 4b31e323647..2bde7f7dab1 100644 --- a/pkg/controller/main-controller.go +++ b/pkg/controller/main-controller.go @@ -231,7 +231,7 @@ func NewController(podName string, namespacesToWatch set.StringSet, kubeClientSe ns := miniov2.GetNSFromFile() ctx := context.Background() oprImg := DefaultOperatorImage - oprDep, err := kubeClientSet.AppsV1().Deployments(ns).Get(ctx, DefaultDeploymentName, metav1.GetOptions{}) + oprDep, err := kubeClientSet.AppsV1().Deployments(ns).Get(ctx, getOperatorDeploymentName(), metav1.GetOptions{}) if err == nil && oprDep != nil { // assume we are the first container, just in case they changed the default name if len(oprDep.Spec.Template.Spec.Containers) > 0 {