Skip to content

Commit

Permalink
Ensure image pull secret configuration is valid
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Alejandro de Brito Fontes <[email protected]>
  • Loading branch information
aledbf committed Sep 8, 2021
1 parent 3f53459 commit c8212eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,30 @@ ifneq (,$(wildcard ./.env))
export
endif

ifneq ($(IMAGE_PULL_SECRET_FILE),)
IMAGE_PULL_SECRET=--volume $(shell realpath ${IMAGE_PULL_SECRET_FILE}):/gitpod/config.json
else
IMAGE_PULL_SECRET=
endif

build: ## Build docker image containing the required tools for the installation
@docker build --quiet . -t ${IMG}
@docker build --squash --quiet . -t ${IMG}
@mkdir -p ${PWD}/logs

DOCKER_RUN_CMD = docker run -it \
--pull always \
--env-file ${PWD}/.env \
--env NODE_ENV=production \
--volume ${PWD}/.kubeconfig:/gitpod/.kubeconfig \
--volume $(shell realpath ${IMAGE_PULL_SECRET_FILE}):/gitpod/config.json \
$(IMAGE_PULL_SECRET) \
--volume ${PWD}/eks-cluster.yaml:/gitpod/eks-cluster.yaml \
--volume ${PWD}/logs:/root/.npm/_logs \
--volume ${HOME}/.aws:/root/.aws \
${IMG} $(1)

install: ## Install Gitpod
@echo "Starting install process..."
touch ${PWD}/.kubeconfig
@touch ${PWD}/.kubeconfig
@$(call DOCKER_RUN_CMD, --install)

uninstall: ## Uninstall Gitpod
Expand Down
3 changes: 2 additions & 1 deletion lib/gitpod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ export class GitpodStack extends cdk.Stack {

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


const values = loadYaml(doc);
createNestedObject(values, ["components", "imageBuilderMk3", "registry"], {});
if (process.env.IMAGE_PULL_SECRET_FILE) {
createNestedObject(values, ["components", "imageBuilderMk3", "registry"], {});
values.components.imageBuilderMk3.registry.secretName = "gitpod-image-pull-secret";
}

Expand Down

0 comments on commit c8212eb

Please sign in to comment.