-
Notifications
You must be signed in to change notification settings - Fork 807
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate image dependency upgrades & Migrate to kubekins-e2e-v2 (#2177)
* Automate kubekins-e2e-v2 & gcb-docker-build image updates * Migrate to kubekins-e2e-v2 (v1 is deprecated) * Update hack/release-scripts/update-e2e-images Co-authored-by: ConnorJC <[email protected]> --------- Co-authored-by: ConnorJC <[email protected]>
- Loading branch information
1 parent
1dbfba8
commit 38f0b20
Showing
5 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
# Copyright 2024 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# --- | ||
# This script updates images used by aws-ebs-csi-driver CI | ||
|
||
set -euo pipefail # Exit on any error | ||
|
||
# --- Environment Variables | ||
export KUBEKINS_IMAGE GCB_IMAGE | ||
|
||
SCRIPT_PATH=$(dirname $(realpath "$0")) | ||
ROOT_DIRECTORY="$SCRIPT_PATH/../.." | ||
|
||
CLOUDBUILD_FILEPATH="$ROOT_DIRECTORY/cloudbuild.yaml" | ||
HELM_VALUES_FILEPATH="$ROOT_DIRECTORY/charts/aws-ebs-csi-driver/values.yaml" | ||
|
||
KUBEKINS_REPO="us-central1-docker.pkg.dev/k8s-staging-test-infra/images/kubekins-e2e" | ||
GCB_REPO="gcr.io/k8s-staging-test-infra/gcb-docker-gcloud" | ||
|
||
# --- Script Tools | ||
log() { | ||
printf "%s [INFO] - %s\n" "$(date +"%Y-%m-%d %H:%M:%S")" "${*}" >&2 | ||
} | ||
|
||
check_dependencies() { | ||
local readonly dependencies=("yq" "git" "crane") | ||
|
||
for cmd in "${dependencies[@]}"; do | ||
if ! command -v "${cmd}" &>/dev/null; then | ||
log "${cmd} binary could not be found, please install it." | ||
exit 1 | ||
fi | ||
done | ||
} | ||
|
||
# --- Script | ||
|
||
check_dependencies | ||
|
||
log "Fetching latest kubekins-e2e-v2 image from $KUBEKINS_REPO" | ||
KUBEKINS_TAG=$(crane ls "$KUBEKINS_REPO" | grep -E 'master$' | sort -V | tail -n 1) | ||
export KUBEKINS_IMAGE="$KUBEKINS_REPO:$KUBEKINS_TAG" | ||
|
||
log "Updating kubekins-e2e-v2 image in $HELM_VALUES_FILEPATH to $KUBEKINS_IMAGE" | ||
yq ".helmTester.image = env(KUBEKINS_IMAGE)" -i "$HELM_VALUES_FILEPATH" | ||
|
||
log "Fetching latest gcb-docker-gcloud image from $GCB_REPO" | ||
GCB_TAG=$(crane ls "$GCB_REPO" | sort -V | tail -n 1) | ||
export GCB_IMAGE="$GCB_REPO:$GCB_TAG" | ||
|
||
log "Updating gcb-docker-gcloud image in $CLOUDBUILD_FILEPATH to $GCB_IMAGE" | ||
yq ".steps[0].name = env(GCB_IMAGE)" -i "$CLOUDBUILD_FILEPATH" | ||
|
||
log "Success! Updated kubekins-e2e-v2 and gcb-docker-gcloud images!" |