Skip to content

Commit 163261c

Browse files
🌱 hack: try to pull from gcr.io/k8s-staging-capi-vsphere/extra/ instead of docker hub (#3408)
* hack: try to pull from gcr.io/k8s-staging-capi-vsphere/extra/ instead of docker hub * separate management latest ci and latest ci versions * fix * review fixes * fix --------- Co-authored-by: Stefan Bueringer <[email protected]>
1 parent 15d2f73 commit 163261c

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

‎hack/ci-e2e-lib.sh‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ k8s::prepareKindestImagesVariables() {
3030
# Ensure kind image get's built full e2e tests.
3131
if [[ "${GINKGO_SKIP:-}" == "\\[Conformance\\] \\[specialized-infra\\]" ]]; then
3232
if [[ "${GINKGO_FOCUS:-}" == "\\[supervisor\\]" ]] || [[ "${GINKGO_FOCUS:-}" == "" ]]; then
33-
KUBERNETES_VERSION_LATEST_CI=$(grep KUBERNETES_VERSION_LATEST_CI: < "$E2E_CONF_FILE" | awk -F'"' '{ print $2}')
34-
echo "Defaulting KUBERNETES_VERSION_LATEST_CI to ${KUBERNETES_VERSION_LATEST_CI} to trigger image build (because env var is not set)"
33+
KUBERNETES_VERSION_MANAGEMENT_LATEST_CI=$(grep KUBERNETES_VERSION_MANAGEMENT_LATEST_CI: < "$E2E_CONF_FILE" | awk -F'"' '{ print $2}')
34+
echo "Defaulting KUBERNETES_VERSION_MANAGEMENT_LATEST_CI to ${KUBERNETES_VERSION_MANAGEMENT_LATEST_CI} to trigger image build (because env var is not set)"
3535
fi
3636
fi
3737

3838
# Ensure kind image get's built vcsim e2e tests.
3939
if [[ -z "${GINKGO_SKIP:-}" ]]; then
4040
if [[ "${GINKGO_FOCUS:-}" == "\\[vcsim\\]" ]] || [[ "${GINKGO_FOCUS:-}" == "\\[vcsim\\] \\[supervisor\\]" ]]; then
41-
KUBERNETES_VERSION_LATEST_CI=$(grep KUBERNETES_VERSION_LATEST_CI: < "$E2E_CONF_FILE" | awk -F'"' '{ print $2}')
42-
echo "Defaulting KUBERNETES_VERSION_LATEST_CI to ${KUBERNETES_VERSION_LATEST_CI} to trigger image build (because env var is not set)"
41+
KUBERNETES_VERSION_MANAGEMENT_LATEST_CI=$(grep KUBERNETES_VERSION_MANAGEMENT_LATEST_CI: < "$E2E_CONF_FILE" | awk -F'"' '{ print $2}')
42+
echo "Defaulting KUBERNETES_VERSION_MANAGEMENT_LATEST_CI to ${KUBERNETES_VERSION_MANAGEMENT_LATEST_CI} to trigger image build (because env var is not set)"
4343
fi
4444
fi
4545
}
@@ -54,9 +54,9 @@ k8s::prepareKindestImages() {
5454
kind::prepareKindestImage "$resolveVersion"
5555
fi
5656

57-
if [ -n "${KUBERNETES_VERSION_LATEST_CI:-}" ]; then
58-
k8s::resolveVersion "KUBERNETES_VERSION_LATEST_CI" "$KUBERNETES_VERSION_LATEST_CI"
59-
export KUBERNETES_VERSION_LATEST_CI=$resolveVersion
57+
if [ -n "${KUBERNETES_VERSION_MANAGEMENT_LATEST_CI:-}" ]; then
58+
k8s::resolveVersion "KUBERNETES_VERSION_MANAGEMENT_LATEST_CI" "$KUBERNETES_VERSION_MANAGEMENT_LATEST_CI"
59+
export KUBERNETES_VERSION_MANAGEMENT_LATEST_CI=$resolveVersion
6060

6161
kind::prepareKindestImage "$resolveVersion"
6262
fi
@@ -197,10 +197,14 @@ EOL
197197
kind::prepullImage () {
198198
local image=$1
199199
image="${image//+/_}"
200+
mirrored_image="gcr.io/k8s-staging-capi-vsphere/extra/${image}"
200201

201202
retVal=0
202203
if [[ "$(docker images -q "$image" 2> /dev/null)" == "" ]]; then
203-
echo "+ Pulling $image"
204+
echo "+ Trying to pull $image from mirror first"
205+
docker pull "$mirrored_image" && docker tag "$mirrored_image" "$image" && return
206+
207+
echo "+ Falling pack to pull from original registry $image"
204208
docker pull "$image" || retVal=$?
205209
else
206210
echo "+ image $image already present in the system, skipping pre-pull"

‎test/e2e/clusterctl_upgrade_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.12
5454
capvVersion := "1.12"
5555
capvStableRelease, err := getStableReleaseOfMinor(ctx, capvReleaseMarkerPrefix, capvVersion)
5656
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", capvVersion)
57-
initKubernetesVersion, err := kubernetesversions.ResolveVersion(ctx, e2eConfig.MustGetVariable("KUBERNETES_VERSION_LATEST_CI"))
57+
initKubernetesVersion, err := kubernetesversions.ResolveVersion(ctx, e2eConfig.MustGetVariable("KUBERNETES_VERSION_MANAGEMENT_LATEST_CI"))
5858
Expect(err).ToNot(HaveOccurred())
5959
return capi_e2e.ClusterctlUpgradeSpecInput{
6060
E2EConfig: e2eConfig,

‎test/e2e/config/vsphere.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ providers:
304304
variables:
305305
# Ensure all Kubernetes versions used here are covered in patch-vsphere-template.yaml
306306
KUBERNETES_VERSION_MANAGEMENT: "v1.33.0-beta.0"
307+
# Note: currently not ci/latest-1.33 because of rate-limiting issues.
308+
KUBERNETES_VERSION_MANAGEMENT_LATEST_CI: "v1.33.0-beta.0"
307309
KUBERNETES_VERSION: "v1.33.0-beta.0"
308310
KUBERNETES_VERSION_UPGRADE_FROM: "v1.32.0"
309311
KUBERNETES_VERSION_UPGRADE_TO: "v1.33.0-beta.0"

0 commit comments

Comments
 (0)