diff --git a/src/google-cloud-cli/README.md b/src/google-cloud-cli/README.md index 682a080..6ce9279 100644 --- a/src/google-cloud-cli/README.md +++ b/src/google-cloud-cli/README.md @@ -16,6 +16,7 @@ Install google-cloud-cli | Options Id | Description | Type | Default Value | |-----|-----|-----|-----| | version | Select or enter a gcloud CLI version | string | latest | +| installGkeGcloudAuthPlugin | Install 'gke-gcloud-auth-plugin' plugin? | boolean | true | diff --git a/src/google-cloud-cli/devcontainer-feature.json b/src/google-cloud-cli/devcontainer-feature.json index f38d7e3..991c16e 100644 --- a/src/google-cloud-cli/devcontainer-feature.json +++ b/src/google-cloud-cli/devcontainer-feature.json @@ -9,6 +9,11 @@ "type": "string", "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..dfdb1a0 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!"