Skip to content

Commit

Permalink
Merge pull request #38 from codenrhoden/fix-docker-login
Browse files Browse the repository at this point in the history
Fix docker login before pushing images
  • Loading branch information
k8s-ci-robot authored Jul 24, 2019
2 parents b7ad177 + 363612d commit f12a0a6
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ readonly CSI_IMAGE_PR=${BASE_IMAGE_REPO}/csi/pr/driver
# CI images
readonly CSI_IMAGE_CI=${BASE_IMAGE_REPO}/csi/ci/driver

AUTH=
PUSH=
LATEST=
CSI_IMAGE_NAME=
Expand Down Expand Up @@ -109,18 +108,10 @@ function build_images() {
fi
}

function logout() {
if [ "${AUTH}" ]; then
gcloud auth revoke
fi
}

function login() {
# If GCR_KEY_FILE is set, use that service account to login
if [ "${GCR_KEY_FILE}" ]; then
trap logout EXIT
gcloud auth activate-service-account --key-file "${GCR_KEY_FILE}" || fatal "unable to login"
AUTH=1
docker login -u _json_key --password-stdin https://gcr.io <"${GCR_KEY_FILE}" || fatal "unable to login"
fi
}

Expand Down

0 comments on commit f12a0a6

Please sign in to comment.