223
223
224
224
# run e2es with ginkgo-e2e.sh
225
225
run_tests () {
226
- # Change to the cloned Kubernetes repository
227
- pushd ../kubernetes
228
-
229
226
# IPv6 clusters need some CoreDNS changes in order to work in k8s CI:
230
227
# 1. k8s CI doesn´t offer IPv6 connectivity, so CoreDNS should be configured
231
228
# to work in an offline environment:
@@ -286,17 +283,6 @@ run_tests() {
286
283
" --report-dir=${ARTIFACTS} " ' --disable-log-dump=true' &
287
284
GINKGO_PID=$!
288
285
wait " $GINKGO_PID "
289
-
290
- # Return to the original directory
291
- popd
292
- }
293
-
294
- # clone kubernetes repo for specific release branch
295
- clone_kubernetes_release () {
296
- # Clone the specific Kubernetes release branch
297
- # Replace "release-1.31" with the desired branch
298
- KUBE_RELEASE_BRANCH=${KUBE_RELEASE_BRANCH:- release-1.31}
299
- git clone --single-branch --branch " ${KUBE_RELEASE_BRANCH} " https://github.com/kubernetes/kubernetes.git
300
286
}
301
287
302
288
main () {
@@ -307,6 +293,13 @@ main() {
307
293
export ARTIFACTS=" ${ARTIFACTS:- ${PWD} / _artifacts} "
308
294
mkdir -p " ${ARTIFACTS} "
309
295
296
+ # Get current and n-1 version numbers
297
+ MAJOR_VERSION=$( ./hack/print-workspace-status.sh | awk ' /STABLE_BUILD_MAJOR_VERSION/ {print $2}' )
298
+ MINOR_VERSION=$( ./hack/print-workspace-status.sh | awk ' /STABLE_BUILD_MINOR_VERSION/ {split($2, minor, "+"); print minor[1]}' )
299
+ export CURRENT_VERSION=" ${MAJOR_VERSION} .${MINOR_VERSION} "
300
+ export N_MINUS_ONE_VERSION=" ${MAJOR_VERSION} .$(( MINOR_VERSION - 1 )) "
301
+ export EMULATED_VERSION=$( N_MINUS_ONE_VERSION)
302
+
310
303
# export the KUBECONFIG to a unique path for testing
311
304
KUBECONFIG=" ${HOME} /.kube/kind-test-config"
312
305
export KUBECONFIG
@@ -327,10 +320,16 @@ main() {
327
320
res=0
328
321
create_cluster || res=$?
329
322
330
- # Clone the specific Kubernetes release branch
331
- clone_kubernetes_release
323
+ # Clone the previous versions Kubernetes release branch
324
+ # TODO(aaron-prindle) extend the branches to test from n-1 -> n-1..3 as more k8s releases are done that support compatibility versions
325
+ export PREV_RELEASE_BRANCH=" release-${EMULATED_VERSION} "
326
+ git clone --filter=blob:none --single-branch --branch " ${PREV_RELEASE_BRANCH} " https://github.com/kubernetes/kubernetes.git " ${PREV_RELEASE_BRANCH} "
332
327
328
+ # enter the release branch and run tests
329
+ pushd " ${PREV_RELEASE_BRANCH} "
333
330
run_tests || res=$?
331
+ popd
332
+
334
333
cleanup || res=$?
335
334
exit $res
336
335
}
0 commit comments