From 8f7db5e4efdb56279f7b25d263d5bdeeaf57aaae Mon Sep 17 00:00:00 2001 From: Max Renaud Date: Fri, 28 Aug 2020 11:24:01 -0700 Subject: [PATCH 1/2] Modify kind-gcr.sh to prevent the use of credsStore --- site/static/examples/kind-gcr.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/site/static/examples/kind-gcr.sh b/site/static/examples/kind-gcr.sh index 19eca93f1a..2a09b64007 100755 --- a/site/static/examples/kind-gcr.sh +++ b/site/static/examples/kind-gcr.sh @@ -10,6 +10,16 @@ DOCKER_CONFIG=$(mktemp -d) export DOCKER_CONFIG trap 'echo "Removing ${DOCKER_CONFIG}/*" && rm -rf ${DOCKER_CONFIG:?}' EXIT +echo "Creating a temporary config.json" +# This is to force the omission of credsStore, which is automatically +# created on supported system. With credsStore missing, "docker login" +# will store the password in the config.json file. +# https://docs.docker.com/engine/reference/commandline/login/#credentials-store +cat < /var/folders/1g/zx664t193xq9_bdmng9f50k800dbxr/T/tmp.htq9tIZy/config.json +{ + "auths": { "gcr.io": {} } +} +EOF # login to gcr in DOCKER_CONFIG using an access token # https://cloud.google.com/container-registry/docs/advanced-authentication#access_token echo "Logging in to GCR in temporary docker client config directory ..." From 96053293ebb435170ae4e31463fe27692b3743c1 Mon Sep 17 00:00:00 2001 From: Max Renaud Date: Fri, 28 Aug 2020 11:37:20 -0700 Subject: [PATCH 2/2] Update site/static/examples/kind-gcr.sh Co-authored-by: Benjamin Elder --- site/static/examples/kind-gcr.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/static/examples/kind-gcr.sh b/site/static/examples/kind-gcr.sh index 2a09b64007..cd695d9b13 100755 --- a/site/static/examples/kind-gcr.sh +++ b/site/static/examples/kind-gcr.sh @@ -15,7 +15,7 @@ echo "Creating a temporary config.json" # created on supported system. With credsStore missing, "docker login" # will store the password in the config.json file. # https://docs.docker.com/engine/reference/commandline/login/#credentials-store -cat < /var/folders/1g/zx664t193xq9_bdmng9f50k800dbxr/T/tmp.htq9tIZy/config.json +cat <"${DOCKER_CONFIG}/config.json" { "auths": { "gcr.io": {} } } @@ -37,4 +37,4 @@ for node in $(kind get nodes --name "${KIND_CLUSTER_NAME}"); do docker exec "${node_name}" systemctl restart kubelet.service done -echo "Done!" \ No newline at end of file +echo "Done!"