@@ -97,7 +97,7 @@ main() {
97
97
res=0
98
98
create_cluster || res=$?
99
99
100
-
100
+ # first step: upgrade binary version while keeping emulated version the same as previous version
101
101
# Perform the upgrade. Assume kind-upgrade.sh is in the same directory as this script.
102
102
UPGRADE_SCRIPT=" ${UPGRADE_SCRIPT:- ${PWD} / ../ test-infra/ experiment/ compatibility-versions/ kind-upgrade.sh} "
103
103
echo " Upgrading cluster with ${UPGRADE_SCRIPT} "
@@ -109,24 +109,36 @@ main() {
109
109
exit $res
110
110
fi
111
111
112
- EMULATED_VERSION_UPGRADE_SCRIPT=" ${EMULATED_VERSION_UPGRADE_SCRIPT:- ${PWD} / ../ test-infra/ experiment/ compatibility-versions/ emulated-version-upgrade.sh} "
113
- echo " Upgrading cluster with ${EMULATED_VERSION_UPGRADE_SCRIPT} "
114
- " ${EMULATED_VERSION_UPGRADE_SCRIPT} " | tee " ${ARTIFACTS} /emulated-upgrade-output.txt"
112
+ # after first step of upgrading binary version without bumping emulated version, verify all tests from the previous version pass
115
113
116
114
# Clone the previous versions Kubernetes release branch
117
115
# TODO(aaron-prindle) extend the branches to test from n-1 -> n-1..3 as more k8s releases are done that support compatibility versions
118
- export RELEASE_BRANCH =" release-${CURRENT_VERSION } "
116
+ export PREV_RELEASE_BRANCH =" release-${PREV_VERSION } "
119
117
# Define the path within the temp directory for the cloned repo
120
- RELEASE_REPO_PATH=" ${TMP_DIR} /release-k8s"
121
- echo " Cloning branch ${RELEASE_BRANCH} into ${RELEASE_REPO_PATH} "
122
- git clone --filter=blob:none --single-branch --branch " ${RELEASE_BRANCH} " https://github.com/kubernetes/kubernetes.git " ${RELEASE_REPO_PATH} "
123
-
118
+ PREV_RELEASE_REPO_PATH=" ${TMP_DIR} /prev-release-k8s"
119
+ echo " Cloning branch ${PREV_RELEASE_BRANCH} into ${PREV_RELEASE_REPO_PATH} "
120
+ git clone --filter=blob:none --single-branch --branch " ${PREV_RELEASE_BRANCH} " https://github.com/kubernetes/kubernetes.git " ${PREV_RELEASE_REPO_PATH} "
124
121
# enter the cloned prev repo branch (in temp) and run tests
125
- pushd " ${RELEASE_REPO_PATH} "
126
- build_prev_version_bins || res=$?
127
- run_prev_version_tests || res=$?
122
+ pushd " ${PREV_RELEASE_REPO_PATH} "
123
+ build_test_bins " ${PREV_RELEASE_BRANCH} " || res=$?
124
+ run_e2e_tests || res=$?
125
+ # debug kubectl version
126
+ kubectl version
127
+ # remove "${PWD}/_output/bin" from PATH
128
+ export PATH=" ${PATH// ${PWD} \/ _output\/ bin: } "
128
129
popd
129
130
131
+ # second step: bump emulated version
132
+ EMULATED_VERSION_UPGRADE_SCRIPT=" ${EMULATED_VERSION_UPGRADE_SCRIPT:- ${PWD} / ../ test-infra/ experiment/ compatibility-versions/ emulated-version-upgrade.sh} "
133
+ echo " Upgrading cluster with ${EMULATED_VERSION_UPGRADE_SCRIPT} "
134
+ " ${EMULATED_VERSION_UPGRADE_SCRIPT} " | tee " ${ARTIFACTS} /emulated-upgrade-output.txt"
135
+
136
+ # verify all tests from the current version pass after upgrade is complete
137
+ # debug kubectl version
138
+ kubectl version
139
+ # run tests at head
140
+ build_test_bins " ${CURRENT_VERSION} " || res=$?
141
+ run_e2e_tests || res=$?
130
142
131
143
cleanup || res=$?
132
144
exit $res
0 commit comments