Skip to content

Commit

Permalink
fix: allow configuring custom operator deployment name (#1762)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuker authored Sep 8, 2023
1 parent 0fa58f7 commit 2f9b7b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
24 changes: 14 additions & 10 deletions helm/operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -30,7 +35,6 @@ operator:
imagePullSecrets: [ ]
runtimeClassName: ~
initContainers: [ ]
env: [ ]
replicaCount: 2
securityContext:
runAsUser: 1000
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/main-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2f9b7b6

Please sign in to comment.