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

Support ipv6 in e2e test #621

Merged
merged 4 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ docker.push: docker

e2e:
Copy link
Member

Choose a reason for hiding this comment

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

Make ipv6 an env, if we want to run e2e test for ipv6 run:

IPFAMILY=ipv6 make e2e

./test/e2e/run_test.sh

./test/e2e/run_test.sh --ipv6

format:
./hack/format.sh
Expand Down
25 changes: 24 additions & 1 deletion test/e2e/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ function setup_kind_cluster() {
fi

# Create KinD cluster.
cat <<EOF | kind create cluster --name="${NAME}" -v4 --retain --image "${IMAGE}" --config=-

Copy link
Member

Choose a reason for hiding this comment

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

You should also add a line here for ipv6 e2e call:

https://github.com/kmesh-net/kmesh/blob/main/Makefile#L149

if [[ -n "${IPV6:-}" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

This if has no corresponding fi?

# Create IPv6 KinD cluster
cat <<EOF | kind create cluster --name="${NAME}" -v4 --retain --image "${IMAGE}" --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
ipFamily: ipv6
nodes:
- role: control-plane
- role: worker
Expand All @@ -39,6 +44,20 @@ containerdConfigPatches:
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d"
EOF
else
# Create default IPv4 KinD cluster
cat <<EOF | kind create cluster --name="${NAME}" -v4 --retain --image "${IMAGE}" --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d"
EOF
fi

status=$?
if [ $status -ne 0 ]; then
Expand Down Expand Up @@ -185,6 +204,10 @@ while (( "$#" )); do
SKIP_BUILD=true
shift
;;
--ipv6)
IPV6=true
shift
;;
esac
done

Expand Down
Loading