Skip to content

Commit

Permalink
Add K8s 1.31 to CI by pinning kops commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSirenko committed Oct 15, 2024
1 parent 8cae810 commit a8a66a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hack/e2e/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ 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"}
Expand Down
5 changes: 4 additions & 1 deletion hack/e2e/kops/kops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function kops_create_cluster() {
KOPS_PATCH_FILE=${10}
KOPS_PATCH_NODE_FILE=${11}
KOPS_STATE_FILE=${12}
export KOPS_RUN_TOO_NEW_VERSION=true

if kops_cluster_exists "${CLUSTER_NAME}" "${KOPS_BIN}" "${KOPS_STATE_FILE}"; then
loudecho "Replacing cluster $CLUSTER_NAME with $CLUSTER_FILE"
Expand Down Expand Up @@ -74,6 +75,7 @@ function kops_cluster_exists() {
CLUSTER_NAME=${1}
KOPS_BIN=${2}
KOPS_STATE_FILE=${3}
export KOPS_RUN_TOO_NEW_VERSION=true
set +e
if ${KOPS_BIN} get cluster --state "${KOPS_STATE_FILE}" "${CLUSTER_NAME}"; then
set -e
Expand All @@ -88,6 +90,7 @@ function kops_delete_cluster() {
KOPS_BIN=${1}
CLUSTER_NAME=${2}
KOPS_STATE_FILE=${3}
export KOPS_RUN_TOO_NEW_VERSION=true
loudecho "Deleting cluster ${CLUSTER_NAME}"
${KOPS_BIN} delete cluster --name "${CLUSTER_NAME}" --state "${KOPS_STATE_FILE}" --yes
}
Expand All @@ -99,7 +102,7 @@ function kops_patch_cluster_file() {
KOPS_PATCH_FILE=${2} # input must be yaml
KIND=${3} # must be either Cluster or InstanceGroup
ROLE=${4} # must be either Master or Node

export KOPS_RUN_TOO_NEW_VERSION=true
loudecho "Patching cluster $CLUSTER_NAME with $KOPS_PATCH_FILE"

# Temporary intermediate files for patching, don't mutate CLUSTER_FILE until
Expand Down
8 changes: 5 additions & 3 deletions hack/tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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="aaa35cc5304f9b191ca9828b552e62bddc5b263a"
# https://pkg.go.dev/sigs.k8s.io/kubetest2?tab=versions
KUBETEST2_VERSION="v0.0.0-20240703180642-53f3d216ad9f"
# https://github.com/golang/mock
Expand Down Expand Up @@ -153,9 +153,11 @@ 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"
# Lower max processes to avoid oom-killed
GOMAXPROCS=1 install_go "${INSTALL_PATH}" "k8s.io/kops/cmd/kops@${KOPS_COMMIT}"
}

function install_kubetest2() {
Expand Down

0 comments on commit a8a66a8

Please sign in to comment.