Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:minio operator should not use a fixed name while deployment. #1762

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions helm/operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

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"
#
### Image field:
## Image from tag (original behaviour), for example:
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