Skip to content

Commit 6ceb88e

Browse files
committed
[werft] More clearly construct a docker registry secret
1 parent 254fe79 commit 6ceb88e

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

.werft/build.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,8 @@ export async function deployToDevWithInstaller(deploymentConfig: DeploymentConfi
365365
const auth = exec(`echo -n "_json_key:$(kubectl get secret ${IMAGE_PULL_SECRET_NAME} --namespace=keys -o yaml \
366366
| yq r - data['.dockerconfigjson'] \
367367
| base64 -d)" | base64 -w 0`, { silent: true }).stdout.trim();
368-
fs.writeFileSync(`./${IMAGE_PULL_SECRET_NAME}`,
369-
`{
370-
"auths": {
371-
"eu.gcr.io": {
372-
"auth": "${auth}"
373-
}
374-
}
375-
}`);
368+
const dockerConfig = { auths: { "eu.gcr.io": { auth: auth } } };
369+
fs.writeFileSync(`./${IMAGE_PULL_SECRET_NAME}`, JSON.stringify(dockerConfig));
376370
exec(`kubectl create secret docker-registry ${IMAGE_PULL_SECRET_NAME} -n ${namespace} --from-file=.dockerconfigjson=./${IMAGE_PULL_SECRET_NAME}`);
377371
werft.done(installerSlices.IMAGE_PULL_SECRET);
378372
}

0 commit comments

Comments
 (0)