Skip to content

Commit

Permalink
feat: add env for default operator image (#1854)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuker committed Nov 14, 2023
1 parent 2810000 commit 661ec01
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/env-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ Operator behavior can be customized using environment variables in the `minio-op
|MINIO_OPERATOR_DEPLOYMENT_NAME| This specifies a custom deployment name for Operator | | `minio-operator` |
|OPERATOR_STS_ENABLED| This toggles the STS Service on or off | `on`, `off` | `on` |
|MINIO_CONSOLE_DEPLOYMENT_NAME| This is the default name of the console deployment | | `console` |
|MINIO_CONSOLE_TLS_ENABLE| This toggles the Console TLS on or off | `on`, `off` | `off` |
|MINIO_CONSOLE_TLS_ENABLE| This toggles the Console TLS on or off | `on`, `off` | `off` | | | |
|WATCHED_NAMESPACE| The namespaces which the operator watches for MinIO tenants. Defaults to `""` for all namespaces. | | |
|MINIO_OPERATOR_IMAGE| This variable controls the image of the minio instance's sidecar and validate-arguments. if not set, the mirrors of the minio instance's sidecar and validate-arguments will use the operator's image. | "" | "" |
3 changes: 3 additions & 0 deletions pkg/controller/main-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (

"github.com/minio/minio-go/v7/pkg/set"
"github.com/minio/operator/pkg/controller/certificates"
"github.com/minio/pkg/env"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/klog/v2"

Expand Down Expand Up @@ -245,6 +246,8 @@ func NewController(podName string, namespacesToWatch set.StringSet, kubeClientSe
}
}

oprImg = env.Get(DefaultOperatorImageEnv, oprImg)

controller := &Controller{
podName: podName,
namespacesToWatch: namespacesToWatch,
Expand Down
2 changes: 2 additions & 0 deletions pkg/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ const (
DefaultDeploymentName = "minio-operator"
// DefaultOperatorImage is the version fo the operator being used
DefaultOperatorImage = "minio/operator:v5.0.10"
// DefaultOperatorImageEnv is the default image to minio instance
DefaultOperatorImageEnv = "MINIO_OPERATOR_IMAGE"
)

var serverCertsManager *xcerts.Manager
Expand Down

0 comments on commit 661ec01

Please sign in to comment.