Skip to content

Commit 93035a6

Browse files
dhoericgithub-actions
andauthored
google-cloud-cli - add gke-gcloud-auth-plugin option (#19)
* google-cloud-cli - add gke-gcloud-auth-plugin option * Automated documentation update [skip ci] --------- Co-authored-by: github-actions <github-actions@github.com>
1 parent e526eb0 commit 93035a6

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/google-cloud-cli/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Install google-cloud-cli
1616
| Options Id | Description | Type | Default Value |
1717
|-----|-----|-----|-----|
1818
| version | Select or enter a gcloud CLI version | string | latest |
19+
| installGkeGcloudAuthPlugin | Install 'gke-gcloud-auth-plugin' plugin? | boolean | true |
1920

2021

2122

src/google-cloud-cli/devcontainer-feature.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
"type": "string",
1010
"default": "latest",
1111
"description": "Select or enter a gcloud CLI version"
12+
},
13+
"installGkeGcloudAuthPlugin": {
14+
"type": "boolean",
15+
"default": true,
16+
"description": "Install 'gke-gcloud-auth-plugin' plugin?"
1217
}
1318
},
1419
"installsAfter": [

src/google-cloud-cli/install.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set -e
66
rm -rf /var/lib/apt/lists/*
77

88
GCLOUD_VERSION=${VERSION:-"latest"}
9+
INSTALL_GKEGCLOUDAUTH_PLUGIN="${INSTALL_GKEGCLOUDAUTH_PLUGIN:-"false"}"
910

1011
if [ "$(id -u)" -ne 0 ]; then
1112
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() {
8788
rm -f /etc/apt/sources.list.d/google-cloud-sdk.list
8889
return 1
8990
fi
91+
92+
# Install gke-gcloud-auth-plugin if needed
93+
if [ "${INSTALL_GKEGCLOUDAUTH_PLUGIN}" = "true" ]; then
94+
echo "(*) Installing 'gke-gcloud-auth-plugin' plugin..."
95+
check_packages google-cloud-sdk-gke-gcloud-auth-plugin
96+
fi
9097
}
9198

9299
echo "(*) Installing google-cloud CLI..."
@@ -98,4 +105,4 @@ install_using_apt
98105
# Clean up
99106
rm -rf /var/lib/apt/lists/*
100107

101-
echo "Done!"
108+
echo "Done!"

0 commit comments

Comments
 (0)