|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Copyright 2025 The Kubernetes Authors. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +set -o errexit |
| 18 | +set -o nounset |
| 19 | +set -o pipefail |
| 20 | + |
| 21 | +# Convenience script that tags the VPA automatically built images with a |
| 22 | +# version tag in preparation for release. |
| 23 | + |
| 24 | +# The following environment variables must be set for this script: |
| 25 | +# BUILD_TAG: corresponds to the tag of the automatic build (eg. v20250512-cluster-autoscaler-chart-9.46.6-151-g2b33c4c79) |
| 26 | +# TAG: corresponds to the version of the release (eg. 1.4.0) |
| 27 | + |
| 28 | +# See VPA release instructions (in RELEASE.md) before using this file. |
| 29 | + |
| 30 | +if [[ -z "$BUILD_TAG" ]]; then |
| 31 | + echo "BUILD_TAG must be set to the existing image build tag (eg. BUILD_TAG=v20250512-cluster-autoscaler-chart-9.46.6-151-g2b33c4c79)" |
| 32 | + exit 1 |
| 33 | +fi |
| 34 | +if [[ -z "$TAG" ]]; then |
| 35 | + echo "TAG must be set to the VPA release number (eg. TAG=1.4.0)" |
| 36 | + exit 1 |
| 37 | +fi |
| 38 | + |
| 39 | +echo "Adding tag $TAG based on built tag $BUILD_TAG" |
| 40 | + |
| 41 | +read -p "Press enter to continue" |
| 42 | + |
| 43 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-admission-controller:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-admission-controller:$TAG --project=k8s-staging-autoscaling |
| 44 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-admission-controller-amd64:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-admission-controller-amd64:$TAG --project=k8s-staging-autoscaling |
| 45 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-admission-controller-arm:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-admission-controller-arm:$TAG --project=k8s-staging-autoscaling |
| 46 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-admission-controller-arm64:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-admission-controller-arm64:$TAG --project=k8s-staging-autoscaling |
| 47 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-admission-controller-ppc64le:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-admission-controller-ppc64le:$TAG --project=k8s-staging-autoscaling |
| 48 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-admission-controller-s390x:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-admission-controller-s390x:$TAG --project=k8s-staging-autoscaling |
| 49 | + |
| 50 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-recommender:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-recommender:$TAG --project=k8s-staging-autoscaling |
| 51 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-recommender-amd64:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-recommender-amd64:$TAG --project=k8s-staging-autoscaling |
| 52 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-recommender-arm:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-recommender-arm:$TAG --project=k8s-staging-autoscaling |
| 53 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-recommender-arm64:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-recommender-arm64:$TAG --project=k8s-staging-autoscaling |
| 54 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-recommender-ppc64le:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-recommender-ppc64le:$TAG --project=k8s-staging-autoscaling |
| 55 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-recommender-s390x:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-recommender-s390x:$TAG --project=k8s-staging-autoscaling |
| 56 | + |
| 57 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-updater:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-updater:$TAG --project=k8s-staging-autoscaling |
| 58 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-updater-amd64:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-updater-amd64:$TAG --project=k8s-staging-autoscaling |
| 59 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-updater-arm:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-updater-arm:$TAG --project=k8s-staging-autoscaling |
| 60 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-updater-arm64:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-updater-arm64:$TAG --project=k8s-staging-autoscaling |
| 61 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-updater-ppc64le:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-updater-ppc64le:$TAG --project=k8s-staging-autoscaling |
| 62 | +gcloud container images add-tag -q gcr.io/k8s-staging-autoscaling/vpa-updater-s390x:$BUILD_TAG gcr.io/k8s-staging-autoscaling/vpa-updater-s390x:$TAG --project=k8s-staging-autoscaling |
0 commit comments