Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add k8s 1.30 version compatibility test #3512

Merged
merged 1 commit into from
May 28, 2024

Conversation

ty-dc
Copy link
Collaborator

@ty-dc ty-dc commented May 21, 2024

Thanks for contributing!

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

@@ -114,7 +114,7 @@ jobs:
fail-fast: false
matrix:
# Synchronise with the latest releases of each version
version: [v1.22.7, v1.23.5, v1.24.4, v1.25.3, v1.26.2, v1.27.1, v1.28.0]
version: [v1.22.7, v1.23.5, v1.24.4, v1.25.3, v1.26.2, v1.27.1, v1.28.0, v1.29.1, v1.30.0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些版本是否有规律,有的 是 v1.22.7 , 有的是 v1.30.0

那么 这些 版本 是否 可以有一个 自动化脚本 更新,而不是人工

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ty-dc ty-dc force-pushed the update-k8s branch 6 times, most recently from 3037dc8 to f83a94f Compare May 25, 2024 14:46
@@ -108,13 +111,62 @@ jobs:
submit: false
secrets: inherit

check_kind_node_version:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// update k8s matrix in step "call_k8s_matrix"
update_k8s_matrix

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


# Copyright 2024 Authors of spidernet-io
# SPDX-License-Identifier: Apache-2.0

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should add more comment on the top to describe the usage and function

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

for tag in $tags; do
if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
# Compatibility testing 1.22 to latest version
if [[ ! $KIND_NODE_VERSION =~ ${tag%.*} && ${tag%.*} > "v1.21" ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the lowest version should not be hard-coded
that could be a parameter of the script

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


echo "Updating k8s matrix run file..."
KIND_NODE_VERSION=""
function update_kindnode_version() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getAllLatestVersion

there is no update operation in the function

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


KIND_NODE_VERSION="${KIND_NODE_VERSION%, }"
KIND_NODE_VERSION="[$KIND_NODE_VERSION]"
origin_version=$(grep -oP '(?<=version: )\[[^\]]+\]' .github/workflows/auto-diff-k8s-ci.yaml)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could get it from the script parameter, rather than grep
which help decouple the code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

call_k8s_matrix:
# k8s versions
strategy:
fail-fast: false
matrix:
# Synchronise with the latest releases of each version
version: [v1.22.7, v1.23.5, v1.24.4, v1.25.3, v1.26.2, v1.27.1, v1.28.0]
# If a new version of kind/node is released, it will be updated automatically.
version: [v1.25.16, v1.26.15, v1.27.13, v1.28.9, v1.29.4, v1.30.0, v1.23.17, v1.24.17, v1.22.17]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be a environment

Copy link
Collaborator Author

@ty-dc ty-dc May 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matrix.version: 要的格式是 [ xxx , xxx ]、或者 version:-1 - 2
环境变量传值 matrix.version 不认,无法解析的 yaml 格式

Signed-off-by: tao.yang <tao.yang@daocloud.io>
Signed-off-by: ty-dc <tao.yang@daocloud.io>
@weizhoublue weizhoublue merged commit 6b60e4d into spidernet-io:main May 28, 2024
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/none no release note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants