Skip to content

Commit 17f12bd

Browse files
Fix registry password template
1 parent 67ffa66 commit 17f12bd

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

codehub/cli/helm/create.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ def admin_to_yaml_str(admin):
4242
placeholder_replacements["SUDOERS"] = " ".join(admins)
4343

4444
placeholder_replacements["REGISTRY_HOSTNAME"] = cloud_state.docker_registry_hostname
45-
placeholder_replacements["REGISTRY_PASSWORD"] = cloud_state.hub_sa_key
45+
# The spaces after newline are important for the indentation in the yaml file
46+
placeholder_replacements["REGISTRY_PASSWORD"] = cloud_state.hub_sa_key.replace(
47+
"\n", "\n "
48+
)
4649
placeholder_replacements["DOCKER_IMAGE"] = cloud_state.docker_image
4750

4851
if "DOCKER_IMAGE_TAG" not in placeholder_replacements:

codehub/templates/hub/imagePullSecrets.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ imagePullSecret:
88
registry: {{REGISTRY_HOSTNAME}}
99
username: {{REGISTRY_USERNAME}}
1010
email: {{REGISTRY_EMAIL}}
11-
password: {{REGISTRY_PASSWORD}}
11+
password: |-
12+
{{REGISTRY_PASSWORD}}
1213
1314
# imagePullSecrets is configuration to reference the k8s Secret resources the
1415
# Helm chart's pods can get credentials from to pull their images.
15-
imagePullSecrets: ['{{IMAGE_PULL_SECRET}}']
16+
imagePullSecrets: ['{{IMAGE_PULL_SECRET}}']

0 commit comments

Comments
 (0)