Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit f3b6228

Browse files
committed
Ensure the image builder secret is configured
1 parent 44b9a48 commit f3b6228

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

setup.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
set -eo pipefail
4-
4+
set -x
55
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)
66
if [ ! -f "${DIR}/.env" ]; then
77
echo "Missing ${DIR}/.env configuration file."
@@ -227,10 +227,6 @@ function install_gitpod() {
227227
gsutil mb "gs://${CONTAINER_REGISTRY_BUCKET}"
228228
fi
229229

230-
if [ -n "${IMAGE_PULL_SECRET_FILE}" ] && [ -f "${IMAGE_PULL_SECRET_FILE}" ]; then
231-
yq e -i '.components.imageBuilderMk3.registry.secretName = "gitpod-image-pull-secret"' "${DIR}/charts/assets/gitpod-values.yaml"
232-
fi
233-
234230
envsubst < "${DIR}/charts/assets/gitpod-values.yaml" | helm upgrade --install gitpod gitpod/gitpod -f -
235231
}
236232

@@ -373,6 +369,11 @@ function install() {
373369
--from-file=.dockerconfigjson="${IMAGE_PULL_SECRET_FILE}" \
374370
--type=kubernetes.io/dockerconfigjson >/dev/null 2>&1 || true
375371
fi
372+
373+
yq e -i '.components.imageBuilderMk3.registry.secretName = "gitpod-image-pull-secret"' "${DIR}/charts/assets/gitpod-values.yaml"
374+
else
375+
# ensure the chart installation does not fail without a secret.
376+
yq e -i '.components.imageBuilderMk3.registry = {}' "${DIR}/charts/assets/gitpod-values.yaml"
376377
fi
377378

378379
install_cert_manager

0 commit comments

Comments
 (0)