Skip to content

Commit e6352b8

Browse files
committed
feat(charts): reuses the value from an existing secret and config
1 parent cff1e92 commit e6352b8

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

charts/registry/templates/registry-cronjob-daily.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ spec:
2727
- -v
2828
- -u
2929
- $(DRYCC_STORAGE_ENDPOINT)
30-
{{- include "builder.envs" . | indent 12 }}
30+
{{- include "registry.envs" . | indent 12 }}
3131
containers:
3232
- image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/registry:{{.Values.imageTag}}
3333
imagePullPolicy: {{.Values.imagePullPolicy}}
@@ -43,5 +43,5 @@ spec:
4343
- --dry-run
4444
- --delete-untagged
4545
{{- end }}
46-
{{- include "builder.envs" . | indent 12 }}
46+
{{- include "registry.envs" . | indent 12 }}
4747
{{- end }}

charts/registry/templates/registry-secret.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ type: Opaque
1010
data:
1111
{{- if eq .Values.global.registryLocation "on-cluster" }}
1212
host: {{ printf "drycc-registry.%s.svc.%s:5000" .Release.Namespace .Values.global.clusterDomain | b64enc }}
13-
secret: {{ randAlphaNum 32 | b64enc }}
13+
secret: {{ include "common.secrets.lookup" (dict "secret" "registry-secret" "key" "secret" "defaultValue" (randAlphaNum 32) "context" $) }}
1414
{{- else }}
1515
host: {{ .Values.host | b64enc }}
1616
organization: {{ .Values.organization | b64enc }}
1717
{{- end }}
18-
username: {{ if .Values.username | default "" | ne "" }}{{ .Values.username | b64enc }}{{ else }}{{ randAlphaNum 32 | b64enc }}{{ end }}
19-
password: {{ if .Values.password | default "" | ne "" }}{{ .Values.password | b64enc }}{{ else }}{{ randAlphaNum 32 | b64enc }}{{ end }}
18+
username: {{ include "common.secrets.lookup" (dict "secret" "registry-secret" "key" "username" "defaultValue" (.Values.username | default (randAlphaNum 32)) "context" $) }}
19+
password: {{ include "common.secrets.lookup" (dict "secret" "registry-secret" "key" "password" "defaultValue" (.Values.password | default (randAlphaNum 32)) "context" $) }}
2020
redirect: {{ .Values.redirect | b64enc }}

charts/registry/values.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ podAntiAffinityPreset:
3939
# registry replicas
4040
replicas: 1
4141
# registry storage redirect
42-
redirect: false
42+
redirect: "false"
4343

4444
concurrencyPolicy: "Replace"
4545

4646
# Service
4747
service:
4848
# Provide any additional service annotations
49-
annotations: {}
49+
annotations: {}
50+
51+
global:
52+
registryLocation: "on-cluster"

0 commit comments

Comments
 (0)