Skip to content

Commit

Permalink
Merge pull request #6206 from jonwraymond/fix-secret
Browse files Browse the repository at this point in the history
fix(cluster-autoscaler-chart): if secretKeyRefNameOverride is true, d…
  • Loading branch information
k8s-ci-robot authored Oct 23, 2023
2 parents 5cea330 + 7e0b682 commit 1ff7028
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/cluster-autoscaler/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ name: cluster-autoscaler
sources:
- https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler
type: application
version: 9.29.3
version: 9.29.4
12 changes: 9 additions & 3 deletions charts/cluster-autoscaler/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{{- if or (eq .Values.cloudProvider "azure") (and (eq .Values.cloudProvider "aws") (not (has "" (list .Values.awsAccessKeyID .Values.awsSecretAccessKey)))) }}
{{- if not .Values.secretKeyRefNameOverride }}
{{- $isAzure := eq .Values.cloudProvider "azure" }}
{{- $isAws := eq .Values.cloudProvider "aws" }}
{{- $awsCredentialsProvided := and .Values.awsAccessKeyID .Values.awsSecretAccessKey }}

{{- if or $isAzure (and $isAws $awsCredentialsProvided) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "cluster-autoscaler.fullname" . }}
namespace: {{ .Release.Namespace }}
data:
{{- if eq .Values.cloudProvider "azure" }}
{{- if $isAzure }}
ClientID: "{{ .Values.azureClientID | b64enc }}"
ClientSecret: "{{ .Values.azureClientSecret | b64enc }}"
ResourceGroup: "{{ .Values.azureResourceGroup | b64enc }}"
Expand All @@ -14,8 +19,9 @@ data:
VMType: "{{ .Values.azureVMType | b64enc }}"
ClusterName: "{{ .Values.azureClusterName | b64enc }}"
NodeResourceGroup: "{{ .Values.azureNodeResourceGroup | b64enc }}"
{{- else if eq .Values.cloudProvider "aws" }}
{{- else if $isAws }}
AwsAccessKeyId: "{{ .Values.awsAccessKeyID | b64enc }}"
AwsSecretAccessKey: "{{ .Values.awsSecretAccessKey | b64enc }}"
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 1ff7028

Please sign in to comment.