Skip to content

Commit

Permalink
Merge pull request #1825 from MaxRenaud/credsstore
Browse files Browse the repository at this point in the history
Modify kind-gcr.sh to prevent the use of credsStore
  • Loading branch information
BenTheElder authored Aug 28, 2020
2 parents c13c54b + 9605329 commit 7051228
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion site/static/examples/kind-gcr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF >"${DOCKER_CONFIG}/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 ..."
Expand All @@ -27,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!"
echo "Done!"

0 comments on commit 7051228

Please sign in to comment.