@@ -53,11 +53,10 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
53
53
secretKeyRef:
54
54
name: { { template " docker-registry.secretName" . } }
55
55
{ {- if and .Values.secrets.haSharedSecretKey .Values.secrets.existingSecret } }
56
- key: { {- .Values.secrets.haSharedSecretKey } }
56
+ key: { { .Values.secrets.haSharedSecretKey } }
57
57
{ {- else } }
58
58
key: haSharedSecret
59
59
{ {- end } }
60
- { {- end } }
61
60
62
61
{ {- if .Values.secrets.htpasswd } }
63
62
- name: REGISTRY_AUTH
@@ -161,20 +160,20 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
161
160
valueFrom:
162
161
secretKeyRef:
163
162
name: { { template " docker-registry.swiftSecretName" . } }
164
- { {- if and .Values.secrets.swift.usernameKey .Values.secrets.swift.secretRef - } }
165
- key: { {- .Values.secrets.swift.usernameKey - } }
166
- { {- else - } }
163
+ { {- if and .Values.secrets.swift.usernameKey .Values.secrets.swift.secretRef } }
164
+ key: { { .Values.secrets.swift.usernameKey } }
165
+ { {- else } }
167
166
key: swiftUsername
168
- { {- end - } }
167
+ { {- end } }
169
168
- name: REGISTRY_STORAGE_SWIFT_PASSWORD
170
169
valueFrom:
171
170
secretKeyRef:
172
171
name: { { template " docker-registry.swiftSecretName" . } }
173
- { {- if and .Values.secrets.swift.passwordKey .Values.secrets.swift.secretRef - } }
174
- key: { {- .Values.secrets.swift.passwordKey - } }
175
- { {- else - } }
172
+ { {- if and .Values.secrets.swift.passwordKey .Values.secrets.swift.secretRef } }
173
+ key: { { .Values.secrets.swift.passwordKey } }
174
+ { {- else } }
176
175
key: swiftPassword
177
- { {- end - } }
176
+ { {- end } }
178
177
- name: REGISTRY_STORAGE_SWIFT_CONTAINER
179
178
value: { { required " .Values.swift.container is required" .Values.swift.container } }
180
179
{ {- end -} }
@@ -186,20 +185,20 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
186
185
valueFrom:
187
186
secretKeyRef:
188
187
name: { { if .Values.proxy.secretRef } }{ { .Values.proxy.secretRef } }{ { else } }{ { template " docker-registry.secretName" . } }{ { end } }
189
- { {- if and .Values.proxy.proxyUsernameKey .Values.proxy.secretRef - } }
190
- key: { {- .Values.proxy.proxyUsernameKey - } }
191
- { {- else - } }
188
+ { {- if and .Values.proxy.proxyUsernameKey .Values.proxy.secretRef } }
189
+ key: { { .Values.proxy.proxyUsernameKey } }
190
+ { {- else } }
192
191
key: proxyUsername
193
- { {- end - } }
192
+ { {- end } }
194
193
- name: REGISTRY_PROXY_PASSWORD
195
194
valueFrom:
196
195
secretKeyRef:
197
196
name: { { if .Values.proxy.secretRef } }{ { .Values.proxy.secretRef } }{ { else } }{ { template " docker-registry.secretName" . } }{ { end } }
198
- { {- if and .Values.proxy.proxyPasswordKey .Values.proxy.secretRef - } }
199
- key: { {- .Values.proxy.proxyPasswordKey - } }
200
- { {- else - } }
197
+ { {- if and .Values.proxy.proxyPasswordKey .Values.proxy.secretRef } }
198
+ key: { { .Values.proxy.proxyPasswordKey } }
199
+ { {- else } }
201
200
key: proxyPassword
202
- { {- end - } }
201
+ { {- end } }
203
202
{ {- end -} }
204
203
205
204
{ {- if .Values.persistence.deleteEnabled } }
@@ -211,11 +210,13 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
211
210
{ { toYaml . } }
212
211
{ {- end -} }
213
212
213
+ { {- end } }
214
+
214
215
{ {- define " docker-registry.volumeMounts" -} }
215
216
- name: "{ { template " docker-registry.fullname" . } }-config"
216
217
mountPath: { { .Values.configPath } }
217
218
218
- { {- if .Values.secrets.htpasswd } }
219
+ { {- if or .Values.secrets.htpasswd .Values.secrets.existingSecret } }
219
220
- name: auth
220
221
mountPath: /auth
221
222
readOnly: true
@@ -243,13 +244,13 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
243
244
configMap:
244
245
name: { { template " docker-registry.fullname" . } }-config
245
246
246
- { {- if .Values.secrets.htpasswd } }
247
+ { {- if or .Values.secrets.htpasswd .Values.secrets.existingSecret } }
247
248
- name: auth
248
249
secret:
249
250
secretName: { { template " docker-registry.secretName" . } }
250
251
items:
251
252
{ {- if and .Values.secrets.htpasswdKey .Values.secrets.existingSecret } }
252
- - key: { {- .Values.secrets.htpasswdKey } }
253
+ - key: { { .Values.secrets.htpasswdKey } }
253
254
path: htpasswd
254
255
{ {- else } }
255
256
- key: htpasswd
0 commit comments