Skip to content

Commit 5705e38

Browse files
committed
[werft] More clearly construct a docker registry secret
1 parent dea760d commit 5705e38

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
@@ -375,14 +375,8 @@ export async function deployToDevWithInstaller(deploymentConfig: DeploymentConfi
375375
const auth = exec(`echo -n "_json_key:$(kubectl get secret ${IMAGE_PULL_SECRET_NAME} --namespace=keys -o yaml \
376376
| yq r - data['.dockerconfigjson'] \
377377
| base64 -d)" | base64 -w 0`, { silent: true }).stdout.trim();
378-
fs.writeFileSync(`./${IMAGE_PULL_SECRET_NAME}`,
379-
`{
380-
"auths": {
381-
"eu.gcr.io": {
382-
"auth": "${auth}"
383-
}
384-
}
385-
}`);
378+
const dockerConfig = { auths: { "eu.gcr.io": { auth: auth } } };
379+
fs.writeFileSync(`./${IMAGE_PULL_SECRET_NAME}`, JSON.stringify(dockerConfig));
386380
exec(`kubectl create secret docker-registry ${IMAGE_PULL_SECRET_NAME} -n ${namespace} --from-file=.dockerconfigjson=./${IMAGE_PULL_SECRET_NAME}`);
387381
werft.done(installerSlices.IMAGE_PULL_SECRET);
388382
}

0 commit comments

Comments
 (0)