jthegedus / asdf-gcloud

☁️ GCloud CLI (Google Cloud SDK) plugin for asdf version manager. Pin gcloud versions for each project!
https://asdf-vm.com
MIT License
55 stars 22 forks source link

fix: kubectl with gke-gcloud-auth-plugin, unbound variable #77

Closed tino415 closed 1 year ago

tino415 commented 1 year ago

Remove forcing all variables to be bound in shell scripts that are run when gcloud commands are executed

Description

Remove set -u option from scripts executed when gcloud commands are executed to support commands without arguments for instance gke-gcloud-auth-plugin

Motivation and Context

gcloud kubectl was not working because it is using command without argument under the hood. It fixes this issue

Types of changes

Usage examples

kubectl get pods without error.

How Has This Been Tested?

Installed locally and tried to run kubectl get pods

Checklist:

sodabrew commented 1 year ago

+1 this worked for me, too. (comment edit: removed red herring alternative suggestion)