@@ -269,6 +269,15 @@ steps:
269
269
270
270
pids=()
271
271
typeset -A waitPids # Associative array for mapping `kubectl wait job` pid -> `kubectl wait job` output log name
272
+ tmpdir=$(mktemp -d)
273
+ trap 'rm -rf -- "$tmpdir"' EXIT SIGTERM
274
+
275
+ # Update image tags to include the current build version.
276
+ DevVersion="1.45.0-dev-$(git rev-parse --short=7 HEAD)"
277
+ export DevVersion
278
+ envsubst < upgradeTest.yaml > "${tmpfile}"/upgradeTest.yaml
279
+ envsubst < versionMap.yaml > "${tmpfile}"/versionMap.yaml
280
+
272
281
# Kill all currently running child processes on exit or if a non-zero signal is seen
273
282
trap 'echo Cleaning up any remaining running pids: $(jobs -p) ; kill $(jobs -p) 2> /dev/null || :' EXIT SIGTERM
274
283
@@ -326,20 +335,12 @@ steps:
326
335
echo kubectl apply -f permissions.yaml on cluster "${testCluster}"
327
336
kubectl apply -f permissions.yaml
328
337
echo kubectl apply -f versionMap.yaml on cluster "${testCluster}"
329
- kubectl apply -f versionMap.yaml
338
+ kubectl apply -f "${tmpfile}"/ versionMap.yaml
330
339
echo kubectl apply -f gameserverTemplate.yaml on cluster "${testCluster}"
331
340
kubectl apply -f gameserverTemplate.yaml
332
341
333
- # TODO: Replace image: us-docker.pkg.dev/agones-images/ci/upgrade-test-controller:1.45.0-dev
334
- # in upgradeTest.yaml with the commit tag (e.g. 1.45.0-dev-d3956c8) and pass the same VERSION as
335
- # environment variable for main.go `DevVersion = os.Getenv("DevVersion")`
336
- echo COMMIT_SHA "$COMMIT_SHA"
337
- echo BUILD_ID "$BUILD_ID"
338
- version="1.45.0-dev-$(git rev-parse --short=7 HEAD)"
339
- echo VERSION "$version"
340
-
341
342
echo kubectl apply -f upgradeTest.yaml on cluster "${testCluster}"
342
- kubectl apply -f upgradeTest.yaml
343
+ kubectl apply -f "${tmpfile}"/ upgradeTest.yaml
343
344
344
345
# We need to wait for job pod to be created and ready before we can wait on the job itself.
345
346
# TODO: Once all test clusters are at Kubernetes Version >= 1.31 use `kubectl wait --for=create` instead of sleep.
@@ -348,10 +349,10 @@ steps:
348
349
kubectl wait --for=condition=ready pod -l job-name=upgrade-test-runner --timeout=5m
349
350
350
351
echo Wait for job upgrade-test-runner to complete or fail on cluster "${testCluster}"
351
- kubectl wait job/upgrade-test-runner --timeout=20m --for jsonpath='{.status.conditions[*].status}'=True -o jsonpath='{.status.conditions[*].type}' | tee "${testCluster}".log &
352
+ kubectl wait job/upgrade-test-runner --timeout=20m --for jsonpath='{.status.conditions[*].status}'=True -o jsonpath='{.status.conditions[*].type}' | tee "${tmpfile}"/"${ testCluster}".log &
352
353
waitPid=$!
353
354
pids+=( "$waitPid" )
354
- waitPids[$waitPid]=${ testCluster}.log
355
+ waitPids[$waitPid]="${tmpfile}"/"${ testCluster}" .log
355
356
done
356
357
done
357
358
0 commit comments