diff --git a/src/google-cloud-cli/devcontainer-feature.json b/src/google-cloud-cli/devcontainer-feature.json index 76b1b16..2eec52f 100644 --- a/src/google-cloud-cli/devcontainer-feature.json +++ b/src/google-cloud-cli/devcontainer-feature.json @@ -12,6 +12,11 @@ ], "default": "latest", "description": "Select or enter a gcloud CLI version" + }, + "installGkeGcloudAuthPlugin": { + "type": "boolean", + "default": true, + "description": "Install 'gke-gcloud-auth-plugin' plugin?" } }, "installsAfter": [ diff --git a/src/google-cloud-cli/install.sh b/src/google-cloud-cli/install.sh index b1c3041..e5f182a 100644 --- a/src/google-cloud-cli/install.sh +++ b/src/google-cloud-cli/install.sh @@ -6,6 +6,7 @@ set -e rm -rf /var/lib/apt/lists/* GCLOUD_VERSION=${VERSION:-"latest"} +INSTALL_GKEGCLOUDAUTH_PLUGIN="${INSTALL_GKEGCLOUDAUTH_PLUGIN:-"false"}" if [ "$(id -u)" -ne 0 ]; then echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' @@ -87,6 +88,12 @@ install_using_apt() { rm -f /etc/apt/sources.list.d/google-cloud-sdk.list return 1 fi + + # Install gke-gcloud-auth-plugin if needed + if [ "${INSTALL_GKEGCLOUDAUTH_PLUGIN}" = "true" ]; then + echo "(*) Installing 'gke-gcloud-auth-plugin' plugin..." + check_packages google-cloud-sdk-gke-gcloud-auth-plugin + fi } echo "(*) Installing google-cloud CLI..." @@ -98,4 +105,4 @@ install_using_apt # Clean up rm -rf /var/lib/apt/lists/* -echo "Done!" \ No newline at end of file +echo "Done!"