diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-08-29 06:56:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-29 06:56:43 -0700 |
commit | ab5f52c0d2ce617f875ef69c9ae67381841a6514 (patch) | |
tree | ccc70cbe33c74a1f55187d3ff0bc05f27a6ffa92 /contrib/imgts/lib_entrypoint.sh | |
parent | 1eb6b271bb1b197c214b9cf560c362a6aeb402da (diff) | |
parent | 370b1a887cbf6db8ac893c39118cf8c6c2fd663c (diff) | |
download | podman-ab5f52c0d2ce617f875ef69c9ae67381841a6514.tar.gz podman-ab5f52c0d2ce617f875ef69c9ae67381841a6514.tar.bz2 podman-ab5f52c0d2ce617f875ef69c9ae67381841a6514.zip |
Merge pull request #3710 from cevich/release_redo
Release redo
Diffstat (limited to 'contrib/imgts/lib_entrypoint.sh')
-rw-r--r-- | contrib/imgts/lib_entrypoint.sh | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/imgts/lib_entrypoint.sh b/contrib/imgts/lib_entrypoint.sh index 7b76c823f..3f6b11128 100644 --- a/contrib/imgts/lib_entrypoint.sh +++ b/contrib/imgts/lib_entrypoint.sh @@ -35,10 +35,15 @@ req_env_var() { gcloud_init() { set +xe - TMPF=$(mktemp -p '' .$(uuidgen)XXXX) - trap "rm -f $TMPF" EXIT - echo "$GCPJSON" > $TMPF && \ - $GCLOUD auth activate-service-account --project "$GCPPROJECT" --key-file=$TMPF || \ + if [[ -n "$1" ]] && [[ -r "$1" ]] + then + TMPF="$1" + else + TMPF=$(mktemp -p '' .$(uuidgen)_XXXX.json) + trap "rm -f $TMPF &> /dev/null" EXIT + echo "$GCPJSON" > $TMPF + fi + $GCLOUD auth activate-service-account --project="$GCPPROJECT" --key-file="$TMPF" || \ die 5 FATAL auth - rm -f $TMPF + rm -f $TMPF &> /dev/null || true # ignore any read-only error } |