From 58312e78869cec21971e79817a0420b26dfb53ca Mon Sep 17 00:00:00 2001 From: Nuru Date: Wed, 16 Oct 2024 19:11:05 -0700 Subject: [PATCH] Add kubectl 1.31, update kubectl binary source URL (#5094) --- .github/auto-label.yml | 3 + .github/workflows/auto-update-packages.yml | 1 + .github/workflows/kubectl-1.31.yml | 266 ++++++++++++++++++ README.md | 1 + docs/badges.md | 1 + docs/targets.md | 1 + vendor/kubectl-1.28/Makefile | 3 +- vendor/kubectl-1.29/Makefile | 2 +- vendor/kubectl-1.30/Makefile | 2 +- vendor/kubectl-1.31/DESCRIPTION | 1 + vendor/kubectl-1.31/LICENSE | 1 + vendor/kubectl-1.31/Makefile | 21 ++ vendor/kubectl-1.31/RELEASE | 1 + vendor/kubectl-1.31/VERSION | 1 + .../kubectl-1.31/kubectl-1.31.post-deinstall | 9 + vendor/kubectl-1.31/kubectl-1.31.post-install | 12 + vendor/kubectl/Makefile | 2 +- 17 files changed, 324 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/kubectl-1.31.yml create mode 100644 vendor/kubectl-1.31/DESCRIPTION create mode 100644 vendor/kubectl-1.31/LICENSE create mode 100644 vendor/kubectl-1.31/Makefile create mode 100644 vendor/kubectl-1.31/RELEASE create mode 100644 vendor/kubectl-1.31/VERSION create mode 100755 vendor/kubectl-1.31/kubectl-1.31.post-deinstall create mode 100755 vendor/kubectl-1.31/kubectl-1.31.post-install diff --git a/.github/auto-label.yml b/.github/auto-label.yml index e29bf75a0f..8379f7e845 100644 --- a/.github/auto-label.yml +++ b/.github/auto-label.yml @@ -284,6 +284,9 @@ vendor/kubectl-1.29: vendor/kubectl-1.30: - any: ["vendor/kubectl-1.30/**"] all: ["!bin/**", "!tasks/**"] +vendor/kubectl-1.31: +- any: ["vendor/kubectl-1.31/**"] + all: ["!bin/**", "!tasks/**"] vendor/kubectl: - any: ["vendor/kubectl/**"] all: ["!bin/**", "!tasks/**"] diff --git a/.github/workflows/auto-update-packages.yml b/.github/workflows/auto-update-packages.yml index beb1a6319a..0500a779f7 100644 --- a/.github/workflows/auto-update-packages.yml +++ b/.github/workflows/auto-update-packages.yml @@ -93,6 +93,7 @@ jobs: - kubectl-1.28 - kubectl-1.29 - kubectl-1.30 + - kubectl-1.31 - kubectx - kubens - kubeval diff --git a/.github/workflows/kubectl-1.31.yml b/.github/workflows/kubectl-1.31.yml new file mode 100644 index 0000000000..34ab8deb76 --- /dev/null +++ b/.github/workflows/kubectl-1.31.yml @@ -0,0 +1,266 @@ +# +# This workflow was created automatically from the `package-template.yml` by running `make -C .github workflows` +# DO NOT EDIT THIS WORKFLOW, changes will be lost on the next update. +# + +name: "kubectl-1.31" +concurrency: + group: ${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }} (${{ inputs.package_version_override || 'LATEST' }}_r${{ inputs.release_number_override || '0' }}) + cancel-in-progress: true +on: + push: + branches: + - main + + paths: + - apk/** + - deb/** + - rpm/** + - tasks/** + - vendor/kubectl-1.31/** + # Do not automatically trigger a build when the workflow file is changed, because we often make mass updates. + # If we need to run all the workflows, we can just uncomment the line below and make new workflows. + # - .github/workflows/kubectl-1.31.yml + + + pull_request: + types: [opened, synchronize, reopened] + # Include '[no ci]' in the commit message to keep the workflow from running on that commit in the PR. + paths: + - apk/** + - deb/** + - rpm/** + - tasks/** + - vendor/kubectl-1.31/** + - .github/workflows/kubectl-1.31.yml + + workflow_dispatch: + inputs: + package_version_override: + description: 'Version of kubectl-1.31 package to build. Defaults to vendor/kubectl-1.31/VERSION.' + required: false + type: string + release_number_override: + description: 'Zero-based release number of kubectl-1.31 package to publish. Defaults to 0 (zero) when version is specified, ignored if not.' + required: false + type: string + +env: + kubectl-1.31_VERSION: ${{ inputs.package_version_override }} + kubectl-1.31_RELEASE: ${{ inputs.release_number_override }} + +permissions: + contents: read + packages: write + attestations: write + id-token: write + +jobs: + # Mergify cannot distinguish between 2 jobs with the same name run from different workflows, + # so each job must have a unique name for the rules to work properly. + # See https://github.com/Mergifyio/mergify/discussions/5082 + # and https://github.com/Mergifyio/mergify/issues/5083 + matrix-kubectl-1_31: + if: github.event_name != 'schedule' + runs-on: ubuntu-latest + outputs: + package-enabled: ${{ steps.info.outputs.package_enabled }} + package-matrix: ${{steps.info.outputs.package_matrix}} + arch-matrix: ${{steps.info.outputs.arch_matrix}} + apk-enabled: ${{ steps.info.outputs.package_enabled == 'true' && steps.info.outputs.apk_package_enabled == 'true' }} + steps: + - uses: actions/checkout@v4 + + - name: Export package build matrix + shell: bash + id: info + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + run: | + echo setting ouputs + make -C vendor/kubectl-1.31 info/github + echo + echo outputs set + + + # Build for alpine linux + # Kept separate because it is old and slightly different from the other package builds + alpine-kubectl-1_31: + needs: matrix-kubectl-1_31 + if: github.event_name != 'schedule' && needs.matrix-kubectl-1_31.outputs.apk-enabled != 'false' + runs-on: ubuntu-latest + strategy: + matrix: + # These versions must be strings. E.g. Otherwise `3.10` -> `3.1` + alpine: + # Now that we are just building 1 binary for all distributions, we do not + # need to track which distribution we are building on. + - 'alpine' + env: + APK_KEY_RSA: "${{ secrets.APK_KEY_RSA }}" + APK_PACKAGES_PATH: ${{github.workspace}}/artifacts/${{matrix.alpine}} + PACKAGER: ops@cloudposse.com + PACKAGER_PRIVKEY: /dev/shm/ops@cloudposse.com.rsa + PACKAGER_PUBKEY: ${{github.workspace}}/artifacts/ops@cloudposse.com.rsa.pub + + container: + image: ghcr.io/cloudposse/packages-apkbuild:${{matrix.alpine}} + credentials: + username: ${{ github.actor }} + password: "${{ secrets.GITHUB_TOKEN }}" + + steps: + # Checkout the packages repo so we can build the packages as a monorepo + - name: "Checkout source code at current commit" + uses: actions/checkout@v4 + + # Export the apk keys as files from secrets + - name: "Export keys" + run: "make -C .github/ export" + + # Build the alpine packages for the matrix version of alpine + - name: "Build alpine packages" + run: "make -C vendor/${{github.workflow}} apk" + + # Verify the packages were built or error + - name: "List packages" + run: 'find ${APK_PACKAGES_PATH} -type f -name \*.apk | xargs --no-run-if-empty ls -l | grep .' + + # Export the artifact filename including path. + # Path must be relative to workdir for Cloudsmith action to be able to find it. + - name: "Set output path to artifact" + id: artifact + shell: bash + run: | + artifact=$(find artifacts/${{matrix.alpine}} -type f -name \*.apk) + echo "path=$artifact" | tee -a $GITHUB_OUTPUT + + # Determine which package organization we should use (e.g. dev or prod) + - name: "Determine package repo" + shell: bash + id: repo + run: | + if [[ ${GITHUB_REF} == 'refs/heads/main' ]]; then + echo "org=${{github.repository_owner}}" | tee -a $GITHUB_OUTPUT + else + echo "org=${{github.repository_owner}}-dev" | tee -a $GITHUB_OUTPUT + fi + env: + GITHUB_REF: ${{ github.ref }} + + # Publish the artifacts + - name: "Push artifact to package repository" + uses: cloudsmith-io/action@v0.6.10 + with: + api-key: ${{ secrets.CLOUDSMITH_API_KEY }} + command: 'push' + format: 'alpine' + owner: '${{steps.repo.outputs.org}}' # Your Cloudsmith account name or org name (namespace) + repo: 'packages' # Your Cloudsmith Repository name (slug) + distro: 'alpine' # Your Distribution (i.e debian, ubuntu, alpine) + release: 'any-version' # Use "any-version" if your package is compatible with more than one version of alpine linux + republish: 'true' # Needed if version is not changing + file: '${{steps.artifact.outputs.path}}' # Package filename (including path) + no-wait-for-sync: 'true' # Skip the waiting for package synchronisation (i.e. upload only) + + # Build packages with fpm package manager + package-kubectl-1_31: + needs: matrix-kubectl-1_31 + # Should not be needed, but without these conditions, this job would fail with an error if the matrix is [] + # and would run with package-type empty if matrix is ["apk"] + if: > + github.event_name != 'schedule' && needs.matrix-kubectl-1_31.outputs.package-enabled != 'false' + && needs.matrix-kubectl-1_31.outputs.package-matrix != '[]' && needs.matrix-kubectl-1_31.outputs.package-matrix != '["apk"]' + + strategy: + matrix: + package-type: ${{ fromJSON(needs.matrix-kubectl-1_31.outputs.package-matrix) }} + arch: ${{ fromJSON(needs.matrix-kubectl-1_31.outputs.arch-matrix) }} + exclude: + - package-type: 'apk' + include: + # Default value for runs-on. Original matrix values will not be overridden, but added ones (like runs-on) can be. + # See https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations + - runs-on: "self-hosted-arm64-large" + # By including `arch: amd64` here, we override the `runs-on` value when the matrix `arch` is `amd64`. + # This also forces the matrix to include `arch: amd64` even if it is not in the original matrix. + # This is why we do not default for amd64 and then override for arm64. (Because it would force arm64 to be included, and some tools are not available for arm64.) + - arch: amd64 + runs-on: "ubuntu-latest" + runs-on: ${{ matrix.runs-on }} + env: + # We are in a bit of a bind here because of how GitHub actions work as of 2020-11-19 + # Although the "workspace" is mounted to the container, it is not mounted + # at `/github/workspace` or ${{github.workspace}}, although through some + # mechanism, an environment variable whose value starts with ${{github.workspace}} + # will have ${{github.workspace}} replaced with the correct mount point. + # + # We need an absolute path for the package build system, since every build happens + # in a different directory, but because the mount point changes, we also + # need a path relative to the initial working directory to communicate between + # the package building container and the cloudsmith action. + PACKAGES_PATH: ${{github.workspace}}/artifacts/${{matrix.package-type}}/any-version + PACKAGE_RELPATH: artifacts/${{matrix.package-type}}/any-version + + # Unfortunately, there is no reasonable way to configure the docker image tag based on the package-type + container: + image: ghcr.io/cloudposse/packages-${{matrix.package-type}}build:latest + credentials: + username: "${{ github.actor }}" + password: "${{ secrets.GITHUB_TOKEN }}" + + steps: + # Checkout the packages repo so we can build the packages as a monorepo + - name: "Checkout source code at current commit" + uses: actions/checkout@v4 + + # Build the packages for the matrix version + - name: "Build ${{matrix.package-type}} packages" + shell: bash + run: | + echo Current directory is $(pwd) + [[ $PACKAGES_PATH =~ ^$(pwd) ]] || { echo Package dir \"$PACKAGES_PATH\" not beneath workdir \"$(pwd)\" >&2; exit 1; } + make -C vendor/${{github.workflow}} ${{matrix.package-type}} + + # Export the artifact filename including path + - name: "Set output path to artifact" + id: artifact + shell: bash + run: | + [[ -n $PACKAGE_RELPATH ]] || { echo Error: PACKAGE_RELPATH is not set >&2; exit 1; } + packages=($(find ${PACKAGE_RELPATH} -type f -name \*.${{matrix.package-type}})) + echo List packages found: + printf "%s\n" "${packages[@]}" | xargs --no-run-if-empty ls -l + echo Error if not exactly 1 package found + (( ${#packages[@]} == 1 )) || { echo "Error: other than 1 package found (${#packages[@]})" >&2; exit 1; } + + echo "setting output" + echo "path=$packages" | tee -a $GITHUB_OUTPUT + + # Determine which package organization we should use (e.g. dev or prod) + - name: "Determine package repo" + shell: bash + id: repo + run: | + if [[ ${GITHUB_REF} == 'refs/heads/main' ]]; then + echo "org=${{github.repository_owner}}" | tee -a $GITHUB_OUTPUT + else + echo "org=${{github.repository_owner}}-dev" | tee -a $GITHUB_OUTPUT + fi + env: + GITHUB_REF: ${{ github.ref }} + + # Publish the artifacts + - name: "Push artifact to package repository" + uses: cloudsmith-io/action@v0.6.10 + with: + api-key: ${{ secrets.CLOUDSMITH_API_KEY }} + command: 'push' + format: '${{matrix.package-type}}' + owner: '${{steps.repo.outputs.org}}' # Your Cloudsmith account name or org name (namespace) + repo: 'packages' # Your Cloudsmith Repository name (slug) + distro: 'any-distro' # Use "any-distro" since our package is compatible with more than more distribution + release: 'any-version' # Use "any-version" since our package is compatible with more than more version + republish: 'true' # Needed if version is not changing + file: '${{steps.artifact.outputs.path}}' # Package filename (including path) + no-wait-for-sync: 'true' # Skip the waiting for package synchronisation (i.e. upload only) diff --git a/README.md b/README.md index 86b7734f74..56c4e5a21e 100644 --- a/README.md +++ b/README.md @@ -411,6 +411,7 @@ kubectl-1.19 \[frozen\] | 1.19.16 | Production-Grade Container Scheduling and [![kubectl-1.28](https://github.com/cloudposse/packages/actions/workflows/kubectl-1.28.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubectl-1.28) | 1.28.13 | Production-Grade Container Scheduling and Management (v1.28) [![kubectl-1.29](https://github.com/cloudposse/packages/actions/workflows/kubectl-1.29.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubectl-1.29) | 1.29.8 | Production-Grade Container Scheduling and Management (v1.29) [![kubectl-1.30](https://github.com/cloudposse/packages/actions/workflows/kubectl-1.30.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubectl-1.30) | 1.30.4 | Production-Grade Container Scheduling and Management (v1.30) +[![kubectl-1.31](https://github.com/cloudposse/packages/actions/workflows/kubectl-1.31.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubectl-1.31) | 1.31.0 | Production-Grade Container Scheduling and Management (v1.31) [![kubectx](https://github.com/cloudposse/packages/actions/workflows/kubectx.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubectx) | 0.9.5 | Switch faster between clusters and namespaces in kubectl [![kubens](https://github.com/cloudposse/packages/actions/workflows/kubens.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubens) | 0.9.5 | Switch faster between clusters and namespaces in kubectl [![kubeval](https://github.com/cloudposse/packages/actions/workflows/kubeval.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubeval)* | 0.16.1 | Validate your Kubernetes configuration files, supports multiple Kubernetes versions diff --git a/docs/badges.md b/docs/badges.md index 01758619c7..c7afbad895 100644 --- a/docs/badges.md +++ b/docs/badges.md @@ -84,6 +84,7 @@ kubectl-1.19 \[frozen\] | 1.19.16 | Production-Grade Container Scheduling and [![kubectl-1.28](https://github.com/cloudposse/packages/actions/workflows/kubectl-1.28.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubectl-1.28) | 1.28.13 | Production-Grade Container Scheduling and Management (v1.28) [![kubectl-1.29](https://github.com/cloudposse/packages/actions/workflows/kubectl-1.29.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubectl-1.29) | 1.29.8 | Production-Grade Container Scheduling and Management (v1.29) [![kubectl-1.30](https://github.com/cloudposse/packages/actions/workflows/kubectl-1.30.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubectl-1.30) | 1.30.4 | Production-Grade Container Scheduling and Management (v1.30) +[![kubectl-1.31](https://github.com/cloudposse/packages/actions/workflows/kubectl-1.31.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubectl-1.31) | 1.31.0 | Production-Grade Container Scheduling and Management (v1.31) [![kubectx](https://github.com/cloudposse/packages/actions/workflows/kubectx.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubectx) | 0.9.5 | Switch faster between clusters and namespaces in kubectl [![kubens](https://github.com/cloudposse/packages/actions/workflows/kubens.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubens) | 0.9.5 | Switch faster between clusters and namespaces in kubectl [![kubeval](https://github.com/cloudposse/packages/actions/workflows/kubeval.yml/badge.svg?branch=main)](https://github.com/cloudposse/packages/actions?query=workflow%3Akubeval)* | 0.16.1 | Validate your Kubernetes configuration files, supports multiple Kubernetes versions diff --git a/docs/targets.md b/docs/targets.md index 2b4a9ea706..06e14cedb2 100644 --- a/docs/targets.md +++ b/docs/targets.md @@ -94,6 +94,7 @@ kubectl-1.27 1.27.16 Production-Grade Container Scheduling and M kubectl-1.28 1.28.13 Production-Grade Container Scheduling and Management (v1.28) kubectl-1.29 1.29.8 Production-Grade Container Scheduling and Management (v1.29) kubectl-1.30 1.30.4 Production-Grade Container Scheduling and Management (v1.30) +kubectl-1.31 1.31.0 Production-Grade Container Scheduling and Management (v1.31) kubectx 0.9.5 Switch faster between clusters and namespaces in kubectl kubens 0.9.5 Switch faster between clusters and namespaces in kubectl kubeval* 0.16.1 Validate your Kubernetes configuration files, supports multiple Kubernetes versions diff --git a/vendor/kubectl-1.28/Makefile b/vendor/kubectl-1.28/Makefile index 4de42aae51..46c180ea63 100644 --- a/vendor/kubectl-1.28/Makefile +++ b/vendor/kubectl-1.28/Makefile @@ -8,7 +8,8 @@ include ../../tasks/Makefile.vendor_includes # Package details export VENDOR = kubernetes -export DOWNLOAD_URL = https://storage.googleapis.com/kubernetes-release/release/v$(PACKAGE_VERSION)/bin/$(OS)/$(ARCH)/kubectl +# dl.k8s.io/v1.28.14/bin/darwin/amd64/kubectl +export DOWNLOAD_URL = https://dl.k8s.io/v$(PACKAGE_VERSION)/bin/$(OS)/$(ARCH)/kubectl export APK_BUILD_TEMPLATE = APKBUILD.github-binary export APKBUILD_DEPENDS += dpkg export APKBUILD_INSTALL_SCRIPTS = $(PACKAGE_NAME).post-install $(PACKAGE_NAME).post-deinstall diff --git a/vendor/kubectl-1.29/Makefile b/vendor/kubectl-1.29/Makefile index be946bc689..0b44445ac3 100644 --- a/vendor/kubectl-1.29/Makefile +++ b/vendor/kubectl-1.29/Makefile @@ -8,7 +8,7 @@ include ../../tasks/Makefile.vendor_includes # Package details export VENDOR = kubernetes -export DOWNLOAD_URL = https://storage.googleapis.com/kubernetes-release/release/v$(PACKAGE_VERSION)/bin/$(OS)/$(ARCH)/kubectl +export DOWNLOAD_URL = https://dl.k8s.io/v$(PACKAGE_VERSION)/bin/$(OS)/$(ARCH)/kubectl export APK_BUILD_TEMPLATE = APKBUILD.github-binary export APKBUILD_DEPENDS += dpkg export APKBUILD_INSTALL_SCRIPTS = $(PACKAGE_NAME).post-install $(PACKAGE_NAME).post-deinstall diff --git a/vendor/kubectl-1.30/Makefile b/vendor/kubectl-1.30/Makefile index e72dceb6c1..6ac7264dd5 100644 --- a/vendor/kubectl-1.30/Makefile +++ b/vendor/kubectl-1.30/Makefile @@ -8,7 +8,7 @@ include ../../tasks/Makefile.vendor_includes # Package details export VENDOR = kubernetes -export DOWNLOAD_URL = https://storage.googleapis.com/kubernetes-release/release/v$(PACKAGE_VERSION)/bin/$(OS)/$(ARCH)/kubectl +export DOWNLOAD_URL = https://dl.k8s.io/v$(PACKAGE_VERSION)/bin/$(OS)/$(ARCH)/kubectl export APK_BUILD_TEMPLATE = APKBUILD.github-binary export APKBUILD_DEPENDS += dpkg export APKBUILD_INSTALL_SCRIPTS = $(PACKAGE_NAME).post-install $(PACKAGE_NAME).post-deinstall diff --git a/vendor/kubectl-1.31/DESCRIPTION b/vendor/kubectl-1.31/DESCRIPTION new file mode 100644 index 0000000000..4d0cfd2498 --- /dev/null +++ b/vendor/kubectl-1.31/DESCRIPTION @@ -0,0 +1 @@ +Production-Grade Container Scheduling and Management (v1.31) diff --git a/vendor/kubectl-1.31/LICENSE b/vendor/kubectl-1.31/LICENSE new file mode 100644 index 0000000000..7a85ddd4e2 --- /dev/null +++ b/vendor/kubectl-1.31/LICENSE @@ -0,0 +1 @@ +APACHE-2.0 diff --git a/vendor/kubectl-1.31/Makefile b/vendor/kubectl-1.31/Makefile new file mode 100644 index 0000000000..cef5095f13 --- /dev/null +++ b/vendor/kubectl-1.31/Makefile @@ -0,0 +1,21 @@ +export MASTER_PACKAGE_NAME = kubectl +export MAJOR_VERSION = 1.31 +export PACKAGE_NAME = $(MASTER_PACKAGE_NAME)-$(MAJOR_VERSION) +export PACKAGE_REPO_NAME = kubernetes +export INSTALL_DIR = /usr/share/${MASTER_PACKAGE_NAME}/${MAJOR_VERSION}/bin + +include ../../tasks/Makefile.vendor_includes + +# Package details +export VENDOR = kubernetes +export DOWNLOAD_URL = https://dl.k8s.io/v$(PACKAGE_VERSION)/bin/$(OS)/$(ARCH)/kubectl +export APK_BUILD_TEMPLATE = APKBUILD.github-binary +export APKBUILD_DEPENDS += dpkg +export APKBUILD_INSTALL_SCRIPTS = $(PACKAGE_NAME).post-install $(PACKAGE_NAME).post-deinstall + +install: + $(call download_binary) + +test: + pinned-package-sanity-check "$(PACKAGE_VERSION)" "$(MAJOR_VERSION)" + $(PACKAGE_EXE) version --client | grep -F $(PACKAGE_VERSION) diff --git a/vendor/kubectl-1.31/RELEASE b/vendor/kubectl-1.31/RELEASE new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/vendor/kubectl-1.31/RELEASE @@ -0,0 +1 @@ +0 diff --git a/vendor/kubectl-1.31/VERSION b/vendor/kubectl-1.31/VERSION new file mode 100644 index 0000000000..34aae156b1 --- /dev/null +++ b/vendor/kubectl-1.31/VERSION @@ -0,0 +1 @@ +1.31.0 diff --git a/vendor/kubectl-1.31/kubectl-1.31.post-deinstall b/vendor/kubectl-1.31/kubectl-1.31.post-deinstall new file mode 100755 index 0000000000..b5ce5f0c91 --- /dev/null +++ b/vendor/kubectl-1.31/kubectl-1.31.post-deinstall @@ -0,0 +1,9 @@ +#!/bin/sh +# This is an Alpine `deinstall` hook that removes the alternative +MASTER_PACKAGE_NAME=kubectl +MAJOR_VERSION=1.31 +PACKAGE_NAME=${MASTER_PACKAGE_NAME}-${MAJOR_VERSION} +INSTALL_DIR=/usr/share/${MASTER_PACKAGE_NAME}/${MAJOR_VERSION}/bin +update-alternatives --remove ${PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet +update-alternatives --remove ${MASTER_PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} --quiet +exit 0 diff --git a/vendor/kubectl-1.31/kubectl-1.31.post-install b/vendor/kubectl-1.31/kubectl-1.31.post-install new file mode 100755 index 0000000000..d9003fa65b --- /dev/null +++ b/vendor/kubectl-1.31/kubectl-1.31.post-install @@ -0,0 +1,12 @@ +#!/bin/sh +# This is an Alpine Package `post-install` hook that links +# an alternative from `/usr/share/${PACKAGE_NAME}/$version/bin` into `/usr/bin/` +MASTER_PACKAGE_NAME=kubectl +MAJOR_VERSION=1.31 +PACKAGE_NAME=${MASTER_PACKAGE_NAME}-${MAJOR_VERSION} +INSTALL_DIR=/usr/share/${MASTER_PACKAGE_NAME}/${MAJOR_VERSION}/bin + +mkdir -p ${INSTALL_DIR} +update-alternatives --install /usr/bin/${PACKAGE_NAME} ${PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} 1 +update-alternatives --install /usr/bin/${MASTER_PACKAGE_NAME} ${MASTER_PACKAGE_NAME} ${INSTALL_DIR}/${PACKAGE_NAME} 31 +exit 0 diff --git a/vendor/kubectl/Makefile b/vendor/kubectl/Makefile index d5495a3ab9..b35deb1f8b 100644 --- a/vendor/kubectl/Makefile +++ b/vendor/kubectl/Makefile @@ -1,7 +1,7 @@ # Package details export VENDOR = kubernetes export PACKAGE_REPO_NAME = kubernetes -export DOWNLOAD_URL = https://storage.googleapis.com/kubernetes-release/release/v$(PACKAGE_VERSION)/bin/$(OS)/$(ARCH)/$(PACKAGE_NAME) +export DOWNLOAD_URL = https://dl.k8s.io/v$(PACKAGE_VERSION)/bin/$(OS)/$(ARCH)/kubectl export APK_BUILD_TEMPLATE = APKBUILD.github-binary export APKBUILD_DEPENDS += dpkg export APKBUILD_INSTALL_SCRIPTS = $(PACKAGE_NAME).post-install $(PACKAGE_NAME).post-deinstall