Skip to content

Commit d86e32a

Browse files
committed
[kots] load dockerConfigJson reigstry names into privateBaseImageAllowList
Follow upto #12174 This PR updates the installer logic to also load the auth's reigstry URL's into `.containerRegistry.privateBaseImageAllowList`. Signed-off-by: Tarun Pothulapati <[email protected]>
1 parent 50623fb commit d86e32a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

install/kots/manifests/gitpod-installer-job.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ spec:
178178
yq e -i ".containerRegistry.privateBaseImageAllowList += \"docker.io\"" "${CONFIG_FILE}"
179179
fi
180180
181+
if [ '{{repl ConfigOptionNotEquals "reg_docker_config" "" }}' = "true" ];
182+
then
183+
DOCKER_CONFIG='{{repl ConfigOptionData "reg_docker_config" | Base64Encode }}'
184+
echo "${DOCKER_CONFIG}" | base64 -d > /tmp/userconfig.json
185+
# Add the registies to the server allowlist
186+
yq e -i ".containerRegistry.privateBaseImageAllowList += $(cat /tmp/userconfig.json | jq '.auths' | jq -rc 'keys')" "${CONFIG_FILE}"
187+
fi
188+
181189
# Output the local registry secret - this is proxy.replicated.com if user hasn't set their own
182190
echo "{{repl LocalRegistryImagePullSecret }}" | base64 -d > /tmp/kotsregistry.json
183191
@@ -360,9 +368,6 @@ spec:
360368
| base64 -d \
361369
> /tmp/currentconfig.json
362370
363-
DOCKER_CONFIG='{{repl ConfigOptionData "reg_docker_config" | Base64Encode }}'
364-
echo "${DOCKER_CONFIG}" | base64 -d > /tmp/userconfig.json
365-
366371
export REGISTRY_SECRET=$(jq -s '.[0] * .[1]' /tmp/userconfig.json /tmp/currentconfig.json | base64 -w 0)
367372
368373
echo "Gitpod: update the in-cluster registry secret"

0 commit comments

Comments
 (0)