From 7a9732a6f18d3b1021a9940fbdc19c05362526a6 Mon Sep 17 00:00:00 2001 From: Drew Sirenko <68304519+AndrewSirenko@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:40:28 +0000 Subject: [PATCH] Add K8s 1.31 to CI by pinning kops commit --- hack/e2e/config.sh | 3 +-- hack/e2e/kops/kops.sh | 2 ++ hack/prow-e2e.sh | 2 ++ hack/tools/install.sh | 7 ++++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hack/e2e/config.sh b/hack/e2e/config.sh index b09e7cac28..ea83d30f9c 100644 --- a/hack/e2e/config.sh +++ b/hack/e2e/config.sh @@ -33,9 +33,8 @@ OUTPOST_ARN=${OUTPOST_ARN:-} OUTPOST_INSTANCE_TYPE=${OUTPOST_INSTANCE_TYPE:-${INSTANCE_TYPE}} # kops: must include patch version (e.g. 1.19.1) -# eksctl: mustn't include patch version (e.g. 1.19) # NOTE: Keep KOPS at v1.29.x until ELB usage bug fixed -K8S_VERSION_KOPS=${K8S_VERSION_KOPS:-1.29.6} +K8S_VERSION_KOPS=${K8S_VERSION_KOPS:-1.31.1} K8S_VERSION_EKSCTL=${K8S_VERSION_EKSCTL:-1.31} EBS_INSTALL_SNAPSHOT=${EBS_INSTALL_SNAPSHOT:-"true"} diff --git a/hack/e2e/kops/kops.sh b/hack/e2e/kops/kops.sh index c76bd90841..883a79ce1e 100644 --- a/hack/e2e/kops/kops.sh +++ b/hack/e2e/kops/kops.sh @@ -19,6 +19,8 @@ set -euo pipefail +export KOPS_RUN_TOO_NEW_VERSION=true + function kops_create_cluster() { CLUSTER_NAME=${1} KOPS_BIN=${2} diff --git a/hack/prow-e2e.sh b/hack/prow-e2e.sh index 9944b828cf..4d331e4dad 100755 --- a/hack/prow-e2e.sh +++ b/hack/prow-e2e.sh @@ -71,6 +71,8 @@ export CLUSTER_NAME="e2e-${BUILD_ID:-${RANDOM}}.k8s.local" export KOPS_BUCKET=${KOPS_BUCKET:-"k8s-kops-csi-shared-e2e"} # Always use us-west-2 in CI, no matter where the local client is export AWS_REGION=us-west-2 +# Allow attempting using newer versions of K8s before kops releases catch up +export KOPS_RUN_TOO_NEW_VERSION=true make cluster/create & PIDS[1]=$! diff --git a/hack/tools/install.sh b/hack/tools/install.sh index 2cee9d96b2..5a2b15ce35 100755 --- a/hack/tools/install.sh +++ b/hack/tools/install.sh @@ -33,8 +33,8 @@ GOMPLATE_VERSION="v4.1.0" # https://github.com/helm/helm HELM_VERSION="v3.15.4" # https://github.com/kubernetes/kops -# NOTE: Keep at v1.29.0 until ELB usage bug fixed -KOPS_VERSION="v1.29.0" +# NOTE: We pin kops to a commit instead of a release to support newer versions of k8s earlier +KOPS_COMMIT="2f877fcf5755b8c6f6a2d937cb1f62dea3a9536a" # https://pkg.go.dev/sigs.k8s.io/kubetest2?tab=versions KUBETEST2_VERSION="v0.0.0-20240703180642-53f3d216ad9f" # https://github.com/golang/mock @@ -153,9 +153,10 @@ function install_helm() { } function install_kops() { + # Build from source so we can test latest Kubernetes version earlier. INSTALL_PATH="${1}" - install_binary "${INSTALL_PATH}" "https://github.com/kubernetes/kops/releases/download/${KOPS_VERSION}/kops-${OS}-${ARCH}" "kops" + install_go "${INSTALL_PATH}" "k8s.io/kops/cmd/kops@${KOPS_COMMIT}" } function install_kubetest2() {