Skip to content

Commit 2ead1ac

Browse files
committed
improved gcp cleanup
1 parent 40e6c11 commit 2ead1ac

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/cleanup.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ cleanup_actors() {
122122
fi
123123
;;
124124
gcp)
125-
if cleanup_provider "gcloud" "gcloud auth revoke --all" "gcloud auth list" "GCP"; then
125+
if cleanup_provider "gcloud" "gcloud auth revoke --all && unset GOOGLE_APPLICATION_CREDENTIALS" "gcloud auth list" "GCP"; then
126126
any_cleanup=true
127127
fi
128128
;;
@@ -146,6 +146,12 @@ cleanup_actors() {
146146
if [[ "$any_cleanup" == false ]]; then
147147
log_info "No active sessions found for any configured providers."
148148
fi
149+
150+
# Remove local copy creds dir
151+
if [ -d "$LOCAL_CREDS_DIR" ]; then
152+
log_info "Removing local copy creds dir"
153+
rm -rf "$LOCAL_CREDS_DIR"
154+
fi
149155

150156
# Clear the configured providers array
151157
configured_providers=()

0 commit comments

Comments
 (0)