Skip to content

Commit b7102ea

Browse files
authored
Modify image registry auth settings for zone handling (#3055)
Updated image registry authentication settings to conditionally set username and password based on zone.
1 parent 0fbf262 commit b7102ea

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

builtin/core/roles/defaults/defaults/main/02-image_registry.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ image_registry:
1313
# Image registry authentication settings
1414
auth:
1515
registry: >-
16-
{{- if .image_registry.type | empty | not }}
16+
{{- if .image_registry.type | empty | not -}}
1717
{{- if .image_registry.ha_vip | empty | not -}}
1818
{{ .image_registry.ha_vip }}
1919
{{- else if .groups.image_registry | default list | empty | not -}}
@@ -30,8 +30,14 @@ image_registry:
3030
hub.kubesphere.com.cn
3131
{{- end -}}
3232
{{- end -}}
33-
username: admin
34-
password: Harbor12345
33+
username: >-
34+
{{- if .zone | ne "cn" -}}
35+
admin
36+
{{- end -}}
37+
password: >-
38+
{{- if .zone | ne "cn" -}}
39+
Harbor12345
40+
{{- end -}}
3541
skip_tls_verify: >-
3642
{{- if .image_registry.type | empty -}}
3743
true

0 commit comments

Comments
 (0)