Skip to content

Commit

Permalink
add kindest/node:1.31.0 for e2e
Browse files Browse the repository at this point in the history
Signed-off-by: tao.yang <[email protected]>
  • Loading branch information
ty-dc committed Sep 22, 2024
1 parent 1d5d889 commit 6618d1b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/auto-diff-k8s-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ env:
PR_REVIWER: weizhoublue, ty-dc
# The range of K8s versions that matrix tests expect to run. All distributions larger than it will be picked to run.
MINIMUM_K8S_VERSION: v1.21
# TODO(ty-dc), refer: https://github.com/spidernet-io/spiderpool/issues/3937
# Currently using kind/node v1.31, it is not possible to setup kind cluster
PENDING_K8S_VERSION: v1.31
K8S_MATRIX_FILE_PATH: .github/workflows/auto-diff-k8s-ci.yaml

on:
Expand Down Expand Up @@ -139,15 +136,8 @@ jobs:
git_status=$(git status --porcelain)
echo "git status: ${git_status}"
if [[ -n "$git_status" ]]; then
git_diff_version=$(git diff ${{ env.K8S_MATRIX_FILE_PATH }} | grep ${{ env.PENDING_K8S_VERSION }})
# Avoid submitting PRs every day after checking for changes.
if [[ -n "$git_diff_version" ]]; then
echo "SKIP_CREATE_PR=true" >> $GITHUB_ENV
echo "The .github/workflows/auto-diff-k8s-ci.yaml of Spiderpool has changed."
else
echo "SKIP_CREATE_PR=false" >> $GITHUB_ENV
echo "The .github/workflows/auto-diff-k8s-ci.yaml of Spiderpool has changed."
fi
echo "The .github/workflows/auto-diff-k8s-ci.yaml of Spiderpool has changed."
echo "SKIP_CREATE_PR=false" >> $GITHUB_ENV
else
echo "The .github/workflows/auto-diff-k8s-ci.yaml of Spiderpool has not changed."
echo "SKIP_CREATE_PR=true" >> $GITHUB_ENV
Expand Down Expand Up @@ -186,7 +176,7 @@ jobs:
matrix:
# Synchronise with the latest releases of each version
# If a new version of kind/node is released, it will be updated automatically.
version: [v1.28.13, v1.29.8, v1.30.4, v1.27.16, v1.26.15, v1.25.16, v1.23.17, v1.24.17, v1.22.17]
version: [v1.28.13, v1.29.8, v1.30.4, v1.27.16, v1.26.15, v1.25.16, v1.31.0, v1.23.17, v1.24.17, v1.22.17]
needs: [call_build_ci_image, get_ref, call_release_chart]
uses: ./.github/workflows/e2e-init.yaml
with:
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/update-golang-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,29 @@ jobs:
- name: Get latest Go version
id: get-go-version
run: |
LATEST_GOLANG_VERSION=$(curl -s --retry 10 https://go.dev/dl/ | grep -oP 'go[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)
LATEST_GOLANG_VERSION=$(curl -s --retry 10 https://go.dev/dl/ | grep -oP 'go[0-9]+\.[0-9]+\.[0-9]+' 2>/dev/null | head -n 1)
LATEST_GOLANG_VERSION=$(echo $LATEST_GOLANG_VERSION | sed 's/go//')
if [ -z "${LATEST_GOLANG_VERSION}" ]; then
echo "Error: Unable to get version number from LATEST_GOLANG_VERSION: ${LATEST_GOLANG_VERSION}"
exit 1
fi
echo "LATEST_GOLANG_VERSION=${LATEST_GOLANG_VERSION}" >> $GITHUB_ENV
- name: Read current Go version from Makefile.version
id: read-makefile-version
run: |
CURRENT_GO_VERSION=$(grep '^GO_VERSION := ' Makefile.version | awk '{print $3}')
CURRENT_GO_VERSION=$( grep -E "^[[:space:]]*GO_VERSION[[:space:]]*:=" Makefile.version | awk -F '=' '{print $2}' | tr -d ' ' )
if [ -z "${CURRENT_GO_VERSION}" ]; then
echo "Error: Unable to extract version number from CURRENT_GO_VERSION: ${CURRENT_GO_VERSION}"
exit 1
fi
echo "CURRENT_GO_VERSION=${CURRENT_GO_VERSION}" >> $GITHUB_ENV
- name: Compare versions and update Makefile.version
run: |
LATEST_GOLANG_VERSION=$(echo $LATEST_GOLANG_VERSION | sed 's/go//')
if [ "$(printf '%s\n' "${LATEST_GOLANG_VERSION}" "${CURRENT_GO_VERSION}" | sort -r | head -n1)" = "${LATEST_GOLANG_VERSION}" ]; then
if [ "$(printf '%s\n' "${LATEST_GOLANG_VERSION}" "${CURRENT_GO_VERSION}" | sort -r | head -n1)" = "${LATEST_GOLANG_VERSION}" ] && [ "${LATEST_GOLANG_VERSION}" != "${CURRENT_GO_VERSION}" ]; then
echo "LATEST_GOLANG_VERSION:${LATEST_GOLANG_VERSION} is greater than CURRENT_GO_VERSION:${CURRENT_GO_VERSION}"
sed -i "s/^GO_VERSION := .*/GO_VERSION := ${LATEST_GOLANG_VERSION}/" Makefile.version
sed -i "s/^GO_VERSION.*/GO_VERSION := ${LATEST_GOLANG_VERSION}/" Makefile.version
echo "updated=true" >> $GITHUB_ENV
else
echo "no update needed, current version CURRENT_GO_VERSION:${CURRENT_GO_VERSION} is up to date."
Expand Down Expand Up @@ -74,4 +82,4 @@ jobs:
base: main
signoff: true
token: ${{ secrets.WELAN_PAT }}
labels: pr/release/robot_update_version
labels: pr/release/robot_update_version, release/none
1 change: 1 addition & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ setup_kind:
echo "the following features are only fully supported in versions higher than v1.29.0." ; \
sed -i '$$ a\runtimeConfig: ' $${NEW_KIND_YAML} ; \
sed -i '$$ a\ api/alpha: "true"' $${NEW_KIND_YAML} ; \
sed -i '$$ a\ api/beta: "true"' $${NEW_KIND_YAML} ; \
sed -i '$$ a\featureGates: ' $${NEW_KIND_YAML} ; \
sed -i '$$ a\ MultiCIDRServiceAllocator: true' $${NEW_KIND_YAML} ; \
if [ "${E2E_SPIDERPOOL_ENABLE_DRA}" == "true" ]; then \
Expand Down

0 comments on commit 6618d1b

Please sign in to comment.