Skip to content

Commit

Permalink
Remove MINIO_OPERATOR_DEPLOYMENT_NAME variable (#2322)
Browse files Browse the repository at this point in the history
remove MINIO_OPERATOR_DEPLOYMENT_NAME variable
  • Loading branch information
ramondeklein committed Sep 20, 2024
1 parent 28d4cd6 commit 868ae2d
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
1 change: 0 additions & 1 deletion docs/env-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. | | |
Expand Down
4 changes: 0 additions & 4 deletions helm/operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions pkg/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion pkg/controller/sts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 868ae2d

Please sign in to comment.