Skip to content

Commit c8212eb

Browse files
committed
Ensure image pull secret configuration is valid
Signed-off-by: Manuel Alejandro de Brito Fontes <[email protected]>
1 parent 3f53459 commit c8212eb

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Makefile

+10-3
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,30 @@ ifneq (,$(wildcard ./.env))
1111
export
1212
endif
1313

14+
ifneq ($(IMAGE_PULL_SECRET_FILE),)
15+
IMAGE_PULL_SECRET=--volume $(shell realpath ${IMAGE_PULL_SECRET_FILE}):/gitpod/config.json
16+
else
17+
IMAGE_PULL_SECRET=
18+
endif
19+
1420
build: ## Build docker image containing the required tools for the installation
15-
@docker build --quiet . -t ${IMG}
21+
@docker build --squash --quiet . -t ${IMG}
1622
@mkdir -p ${PWD}/logs
1723

1824
DOCKER_RUN_CMD = docker run -it \
25+
--pull always \
1926
--env-file ${PWD}/.env \
2027
--env NODE_ENV=production \
2128
--volume ${PWD}/.kubeconfig:/gitpod/.kubeconfig \
22-
--volume $(shell realpath ${IMAGE_PULL_SECRET_FILE}):/gitpod/config.json \
29+
$(IMAGE_PULL_SECRET) \
2330
--volume ${PWD}/eks-cluster.yaml:/gitpod/eks-cluster.yaml \
2431
--volume ${PWD}/logs:/root/.npm/_logs \
2532
--volume ${HOME}/.aws:/root/.aws \
2633
${IMG} $(1)
2734

2835
install: ## Install Gitpod
2936
@echo "Starting install process..."
30-
touch ${PWD}/.kubeconfig
37+
@touch ${PWD}/.kubeconfig
3138
@$(call DOCKER_RUN_CMD, --install)
3239

3340
uninstall: ## Uninstall Gitpod

lib/gitpod.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ export class GitpodStack extends cdk.Stack {
5353

5454
replace(/{{issuerName}}/g, 'ca-issuer');
5555

56+
5657
const values = loadYaml(doc);
58+
createNestedObject(values, ["components", "imageBuilderMk3", "registry"], {});
5759
if (process.env.IMAGE_PULL_SECRET_FILE) {
58-
createNestedObject(values, ["components", "imageBuilderMk3", "registry"], {});
5960
values.components.imageBuilderMk3.registry.secretName = "gitpod-image-pull-secret";
6061
}
6162

0 commit comments

Comments
 (0)