Files
zuul-operator/playbooks/files/update-operator.sh
Tristan Cacqueray ee8a7b2cfb Remove command args override and update operator-framework to v1.4.2
This change fixes an issue where zuul services can't create
a lockfile.

Another issue happening with older operator-framework and newer
kubernetes version is being fixed by updating the operator-framework
following this migration documentation:
  https://sdk.operatorframework.io/docs/building-operators/ansible/migration/

Change-Id: I6adfb907184112f0b7debb050975f76cd1dd4b01
2021-04-06 17:23:56 +00:00

21 lines
694 B
Bash
Executable File

#!/bin/bash -e
# Update the operator image
echo "Remove previous operator"
kubectl delete -f deploy/operator.yaml || :
BUILDAH_OPTS=${BUILDAH_OPTS:-}
if test -d /var/lib/silverkube/storage; then
BUILDAH_OPTS="${BUILDAH_OPTS} --root /var/lib/silverkube/storage --storage-driver vfs"
fi
echo "Update local image"
CTX=$(sudo buildah from --pull-never ${BUILDAH_OPTS} docker.io/zuul/zuul-operator:latest)
MNT=$(sudo buildah mount ${BUILDAH_OPTS} $CTX)
sudo rsync -avi --delete roles/ ${MNT}/opt/ansible/roles/
sudo rsync -avi --delete conf/ ${MNT}/opt/ansible/conf/
sudo buildah commit ${BUILDAH_OPTS} --rm ${CTX} docker.io/zuul/zuul-operator:latest
kubectl apply -f deploy/operator.yaml