1515# limitations under the License.
1616
1717REPO_ROOT=$( git rev-parse --show-toplevel) ;
18+ TEST_ROOT=" ${REPO_ROOT} /tests/e2e/scenarios/addon-resource-tracking"
1819
1920export KOPS_FEATURE_FLAGS=" SpecOverrideFlag"
20- source " ${REPO_ROOT} " /tests/e2e/scenarios/lib/common.sh
2121
22- function haveds() {
23- local ds=0
24- kubectl get ds -n kube-system aws-node-termination-handler --show-labels || ds=$?
25- return $ds
26- }
27-
28- # Start a cluster with an old version of channel
29-
30- export KOPS_BASE_URL
31- KOPS_BASE_URL=" https://artifacts.k8s.io/binaries/kops/1.29.2"
32- KOPS=$( kops-download-from-base)
33-
34- # Start with a cluster running nodeTerminationHandler
35- ARGS=" --set=cluster.spec.cloudProvider.aws.nodeTerminationHandler.enabled=true"
36- ARGS=" ${ARGS} --set=cluster.spec.cloudProvider.aws.nodeTerminationHandler.enableSQSTerminationDraining=false"
37-
38- ${KUBETEST2} \
39- --up \
22+ make test-e2e-install
23+
24+ # Download kOps 1.29.2 to create the initial cluster
25+ export KOPS_BASE_URL=" https://artifacts.k8s.io/binaries/kops/1.29.2"
26+ KOPS_BIN=$( mktemp -t kops.XXXXXXXXX)
27+ wget -qO " ${KOPS_BIN} " " $KOPS_BASE_URL /$( go env GOOS) /$( go env GOARCH) /kops"
28+ chmod +x " ${KOPS_BIN} "
29+
30+ # Create cluster with nodeTerminationHandler enabled (DaemonSet mode)
31+ CREATE_ARGS=" --networking calico"
32+ CREATE_ARGS=" ${CREATE_ARGS} --set=cluster.spec.cloudProvider.aws.nodeTerminationHandler.enabled=true"
33+ CREATE_ARGS=" ${CREATE_ARGS} --set=cluster.spec.cloudProvider.aws.nodeTerminationHandler.enableSQSTerminationDraining=false"
34+
35+ KUBETEST2_ARGS=()
36+ KUBETEST2_ARGS+=(" -v=2" )
37+ KUBETEST2_ARGS+=(" --env=KOPS_FEATURE_FLAGS=${KOPS_FEATURE_FLAGS} " )
38+ KUBETEST2_ARGS+=(" --kops-binary-path=${KOPS_BIN} " )
39+
40+ kubetest2 kops \
41+ --up --down \
42+ " ${KUBETEST2_ARGS[@]} " \
43+ --cloud-provider=aws \
44+ --create-args=" ${CREATE_ARGS} " \
4045 --kubernetes-version=" 1.29.8" \
41- --kops-binary-path=" ${KOPS} " \
42- --create-args=" $ARGS "
43-
44-
45- if ! haveds; then
46- echo " Expected aws-node-termination-handler to exist"
47- exit 1
48- fi
49-
50- # Upgrade to a version that should adopt existing resources and apply the change below
51- kops-acquire-latest
52-
53- cp " ${KOPS} " " ${WORKSPACE} /kops"
54-
55- # Switch to queue mode. This should remove the DS and install a Deployment instead
56- kops edit cluster " ${CLUSTER_NAME} " " --set=cluster.spec.cloudProvider.aws.nodeTerminationHandler.enableSQSTerminationDraining=true"
57-
58- # allow downgrade is a bug where the version written to VFS is not the same as the running version.
59- kops update cluster --allow-kops-downgrade
60- kops update cluster --yes --allow-kops-downgrade
61-
62- # Rolling-upgrade is needed so we get the new channels binary that supports prune
63- kops rolling-update cluster --instance-group-roles=master --yes
64-
65- # just make sure pods are ready
66- kops validate cluster --wait=5m
67-
68- # We should no longer have a daemonset called aws-node-termination-handler
69- if haveds; then
70- echo " Expected aws-node-termination-handler to have been pruned"
71- exit 1
72- fi
46+ --test=exec -- " ${TEST_ROOT} /test.sh"
0 commit comments