Skip to content

Commit fbab50f

Browse files
Add a delay and check to ensure that SPOD patch is rolled out
1 parent bcff570 commit fbab50f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

hack/ci/install-spo.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,23 @@ install_operator() {
101101
k_wait pod -l name=spod
102102

103103
wait_for spod spod
104+
INITIAL_SPOD_DS_VERSION=$(k get controllerrevision -l name=spod --sort-by=.revision -o=jsonpath='{.items[-1].revision}' 2>/dev/null)
105+
106+
if [[ -z "$INITIAL_SPOD_DS_VERSION" ]]; then
107+
echo "Error: DaemonSet 'spod' not found or could not get its status."
108+
exit 1
109+
fi
104110
k patch spod spod --type=merge -p '{"spec":{"enableBpfRecorder":true}}'
111+
# Wait for security profiles operator to modify the spod daemonset
112+
sleep 5
105113
k rollout status ds spod --timeout 360s
114+
PATCHED_SPOD_DS_VERSION=$(k get controllerrevision -l name=spod --sort-by=.revision -o=jsonpath='{.items[-1].revision}' 2>/dev/null)
115+
116+
if [ "$PATCHED_SPOD_DS_VERSION" -gt "$INITIAL_SPOD_DS_VERSION" ]; then
117+
echo "Success! The DaemonSet version has been updated from $INITIAL_SPOD_DS_VERSION to $PATCHED_SPOD_DS_VERSION."
118+
else
119+
echo "Failure. The DaemonSet version did not change. It is still $PATCHED_SPOD_DS_VERSION."
120+
exit 1
121+
fi
106122
k_wait spod spod
107123
}

hacking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ OpenShift cluster's configuration file, and you need to be successfully logged i
185185

186186
For convenience, the `Makefile` contains a target called `deploy-openshift-dev` which
187187
deploys SPO in an OpenShift cluster with the appropriate defaults (SELinux is on by default)
188-
and the appropriate settings (no cert-manager needed). It should be noted that `deploy-openshit-dev`
188+
and the appropriate settings (no cert-manager needed). It should be noted that `deploy-openshift-dev`
189189
will not enable eBPF and app-armor capabilities (APPARMOR_ENABLED=0, BPF_ENABLED=0).
190190

191191
If you modify the code and need to push the images to the cluster again, use the

0 commit comments

Comments
 (0)