kata-deploy: Adapt regex for testing kata-deploy

On commit a649d33 we've started adding the specific version of the image
to be used, in order to ensure people using our content from a tarball
would be relying on the correct image.

However, later on, @bergwolf figured out it had some undesired side
effects, such as
https://github.com/kata-containers/kata-containers/runs/2235812941?check_suite_focus=true

What happens there is that the regular expression used to point the
image to a testing one doesn't take into consideration the $VERSION, and
that breaks the deployment.

Fixes: #1632

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
(cherry picked from commit d43098ec21)
This commit is contained in:
Fabiano Fidêncio 2021-04-06 20:32:57 +02:00
parent 144be14547
commit 55bdd1fcf4

View File

@ -98,6 +98,7 @@ function test_kata() {
[[ -z "$PKG_SHA" ]] && die "no PKG_SHA provided" [[ -z "$PKG_SHA" ]] && die "no PKG_SHA provided"
YAMLPATH="./tools/packaging/kata-deploy/" YAMLPATH="./tools/packaging/kata-deploy/"
VERSION=$(cat ./VERSION)
# This action could be called in two contexts: # This action could be called in two contexts:
# 1. Packaging workflows: testing in packaging repository, where we assume yaml/packaging # 1. Packaging workflows: testing in packaging repository, where we assume yaml/packaging
@ -120,8 +121,8 @@ function test_kata() {
kubectl get runtimeclasses kubectl get runtimeclasses
# update deployment daemonset to utilize the container under test: # update deployment daemonset to utilize the container under test:
sed -i "s#katadocker/kata-deploy#katadocker/kata-deploy-ci:${PKG_SHA}#g" $YAMLPATH/kata-deploy/base/kata-deploy.yaml sed -i "s#katadocker/kata-deploy:${VERSION}#katadocker/kata-deploy-ci:${PKG_SHA}#g" $YAMLPATH/kata-deploy/base/kata-deploy.yaml
sed -i "s#katadocker/kata-deploy#katadocker/kata-deploy-ci:${PKG_SHA}#g" $YAMLPATH/kata-cleanup/base/kata-cleanup.yaml sed -i "s#katadocker/kata-deploy:${VERSION}#katadocker/kata-deploy-ci:${PKG_SHA}#g" $YAMLPATH/kata-cleanup/base/kata-cleanup.yaml
cat $YAMLPATH/kata-deploy/base/kata-deploy.yaml cat $YAMLPATH/kata-deploy/base/kata-deploy.yaml