From 95f007b72b8cd033348b27201fff839b0a93d9e5 Mon Sep 17 00:00:00 2001 From: Ramon de Klein Date: Thu, 19 Sep 2024 22:03:47 +0200 Subject: [PATCH] remove MINIO_OPERATOR_DEPLOYMENT_NAME variable --- docs/env-variables.md | 1 - helm/operator/values.yaml | 4 ---- pkg/controller/operator.go | 8 -------- pkg/controller/sts.go | 2 +- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/docs/env-variables.md b/docs/env-variables.md index 7dc050716cd..09d71367063 100644 --- a/docs/env-variables.md +++ b/docs/env-variables.md @@ -8,7 +8,6 @@ Operator behavior can be customized using environment variables in the `minio-op |MINIO_OPERATOR_CSR_SIGNER_NAME| The name to use for the CSR Signer. It will override the default | | `kubernetes.io/kubelet-serving` | |SUBNET_BASE_URL| Subnet base URL | | https://subnet.min.io | |OPERATOR_CERT_PASSWD| This is used to decrypt the private key in the TLS certificate for operator, if needed | | | -|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` | |OPERATOR_STS_AUTO_TLS_ENABLED| Env variable name to turn on and off generating the STS TLS certificate automatically using CSR. If it is disabled, you must provide a certificate issued externally | `on`, `off` | `on` | |WATCHED_NAMESPACE| The namespaces which the operator watches for MinIO tenants. Defaults to `""` for all namespaces. | | | diff --git a/helm/operator/values.yaml b/helm/operator/values.yaml index 434d72e294d..169e6e11975 100644 --- a/helm/operator/values.yaml +++ b/helm/operator/values.yaml @@ -10,10 +10,6 @@ operator: # .. code-block:: yaml # # env: - # - name: MINIO_OPERATOR_DEPLOYMENT_NAME - # valueFrom: - # fieldRef: - # fieldPath: metadata.labels['app.kubernetes.io/name'] # - name: CLUSTER_DOMAIN # value: "cluster.domain" # - name: WATCHED_NAMESPACE diff --git a/pkg/controller/operator.go b/pkg/controller/operator.go index 1cffa9eb0f4..0e68286c877 100644 --- a/pkg/controller/operator.go +++ b/pkg/controller/operator.go @@ -33,7 +33,6 @@ import ( miniov2 "github.com/minio/operator/pkg/apis/minio.min.io/v2" xcerts "github.com/minio/pkg/certs" - "github.com/minio/pkg/env" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -43,8 +42,6 @@ import ( const ( // CertPasswordEnv Env variable is used to decrypt the private key in the TLS certificate for operator if need it CertPasswordEnv = "OPERATOR_CERT_PASSWD" - // OperatorDeploymentNameEnv Env variable to specify a custom deployment name for Operator - OperatorDeploymentNameEnv = "MINIO_OPERATOR_DEPLOYMENT_NAME" // OperatorCATLSSecretName is the name of the secret for the operator CA OperatorCATLSSecretName = "operator-ca-tls" // DefaultDeploymentName is the default name of the operator deployment @@ -304,8 +301,3 @@ func (c *Controller) createBuckets(ctx context.Context, tenant *miniov2.Tenant, } return created, err } - -// getOperatorDeploymentName Internal func returns the Operator deployment name from MINIO_OPERATOR_DEPLOYMENT_NAME ENV variable or the default name -func getOperatorDeploymentName() string { - return env.Get(OperatorDeploymentNameEnv, DefaultDeploymentName) -} diff --git a/pkg/controller/sts.go b/pkg/controller/sts.go index 6d64b6257a0..9507095b0d0 100644 --- a/pkg/controller/sts.go +++ b/pkg/controller/sts.go @@ -413,7 +413,7 @@ func IsSTSAutocertEnabled() bool { // generateConsoleTLSCert Issues the Operator Console TLS Certificate func (c *Controller) generateSTSTLSCert() (*string, *string) { - return c.generateTLSCertificateForService("sts", STSTLSSecretName, getOperatorDeploymentName()) + return c.generateTLSCertificateForService("sts", STSTLSSecretName, DefaultDeploymentName) } // waitSTSTLSCert Waits for the Operator leader to issue the TLS Certificate for STS