summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinston Astrachan2022-05-24 11:40:28 -0400
committerWinston Astrachan2022-05-24 11:40:28 -0400
commit736247569e2d64b10113527c868387de129fc0d2 (patch)
treef73770c5b7a0460f06a08ed9fe6d2705349a9fcd
downloadaur-736247569e2d64b10113527c868387de129fc0d2.tar.gz
feat: create google-cloud-sdk-gke-gcloud-auth-plugin package
-rw-r--r--.SRCINFO13
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD48
-rw-r--r--google-cloud-sdk-gke-gcloud-auth-plugin.install32
4 files changed, 94 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..6b1166cacd60
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,13 @@
+pkgbase = google-cloud-sdk-gke-gcloud-auth-plugin
+ pkgdesc = A google-cloud-sdk component that provides a kubectl authentication plugin for GKE.
+ pkgver = 386.0.0
+ pkgrel = 1
+ url = https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
+ arch = x86_64
+ license = Apache
+ depends = google-cloud-sdk
+ options = !strip
+ source = google-cloud-sdk-gke-gcloud-auth-plugin-386.0.0.deb::https://packages.cloud.google.com/apt/pool/google-cloud-cli-gke-gcloud-auth-plugin_386.0.0-0_amd64_095c8216e22dc1b9b65e15a1d9b31633c0f033645e56c5518cbc2ee00f2411a9.deb
+ sha256sums = 095c8216e22dc1b9b65e15a1d9b31633c0f033645e56c5518cbc2ee00f2411a9
+
+pkgname = google-cloud-sdk-gke-gcloud-auth-plugin
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..72e8ffc0db8a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d4fc1efa9ecd
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: Winston Astrachan <winston dot astrachan at gmail dot com>
+
+pkgname=google-cloud-sdk-gke-gcloud-auth-plugin
+_debname=google-cloud-cli-gke-gcloud-auth-plugin
+_debshasum=095c8216e22dc1b9b65e15a1d9b31633c0f033645e56c5518cbc2ee00f2411a9
+pkgver=386.0.0
+pkgrel=1
+pkgdesc="A google-cloud-sdk component that provides a kubectl authentication plugin for GKE."
+arch=('x86_64')
+url="https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke"
+license=('Apache')
+depends=('google-cloud-sdk')
+options=('!strip')
+source=("$pkgname-$pkgver.deb::https://packages.cloud.google.com/apt/pool/${_debname}_${pkgver}-0_amd64_${_debshasum}.deb")
+sha256sums=("$_debshasum")
+install="${pkgname}.install"
+
+prepare() {
+ tar -axvf "${srcdir}/data.tar.xz"
+}
+
+package() {
+ cd "$srcdir"
+
+ # Install plugin manifests and snapshots
+ manifests=(
+ "gke-gcloud-auth-plugin-linux-x86_64.manifest"
+ "gke-gcloud-auth-plugin-linux-x86_64.snapshot.json"
+ "gke-gcloud-auth-plugin.manifest"
+ "gke-gcloud-auth-plugin.snapshot.json"
+ )
+ for item in ${manifests[@]}; do
+ install -Dm644 \
+ "${srcdir}/usr/lib/google-cloud-sdk/.install/${item}" \
+ "${pkgdir}/opt/google-cloud-sdk/.install/${item}"
+ done
+
+ # Install plugin binary
+ install -Dm755 \
+ "${srcdir}/usr/lib/google-cloud-sdk/bin/gke-gcloud-auth-plugin" \
+ "${pkgdir}/opt/google-cloud-sdk/bin/gke-gcloud-auth-plugin"
+
+ # Symlink plugin binary
+ install -dm755 "${pkgdir}/usr/bin/"
+ ln -s \
+ "/opt/google-cloud-sdk/bin/gke-gcloud-auth-plugin" \
+ "${pkgdir}/usr/bin/gke-gcloud-auth-plugin"
+}
diff --git a/google-cloud-sdk-gke-gcloud-auth-plugin.install b/google-cloud-sdk-gke-gcloud-auth-plugin.install
new file mode 100644
index 000000000000..055edc3a4a8e
--- /dev/null
+++ b/google-cloud-sdk-gke-gcloud-auth-plugin.install
@@ -0,0 +1,32 @@
+post_install() {
+ echo ""
+ note_header "Important information about kubectl versions < 1.25"
+ echo ""
+ note "Starting in kubectl v1.25, this plugin will be required for authentication."
+ note "In order to run kubectl with the new plugin prior to the release of v1.25:"
+ note ""
+ note " 1) Set the USE_GKE_GCLOUD_AUTH_PLUGIN=True environment variable"
+ note ""
+ note " 2) Run the following command:"
+ note ""
+ note " gcloud container clusters get-credentials CLUSTER_NAME"
+ note ""
+ note " Replace the CLUSTER_NAME with the name of your cluster."
+ note " This will force the config for this cluster to be updated to"
+ note " the Client-go Credential Plugin configuration."
+ note ""
+ note "https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke"
+ echo ""
+}
+
+# Pacman-like colors
+reset="$(tput sgr0)"
+bold="${reset}$(tput bold)"
+blue="${bold}$(tput setaf 4)"
+yellow="${bold}$(tput setaf 3)"
+note_header() {
+ printf "${yellow}==> NOTE: ${bold}$1${reset}\n"
+}
+note() {
+ printf "${blue} -> ${bold}$1${reset}\n"
+}