Skip to content

Commit

Permalink
Available CRDs check feature w script
Browse files Browse the repository at this point in the history
Adds a script that bypasses pod restarts

Signed-off-by: raaizik <[email protected]>
Co-Authored-By: Rewant Soni <[email protected]>
  • Loading branch information
raaizik and rewantsoni committed Sep 27, 2024
1 parent 4f0c488 commit 1d44aac
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ COPY --from=builder workspace/provider-api /usr/local/bin/provider-api
COPY --from=builder workspace/onboarding-validation-keys-gen /usr/local/bin/onboarding-validation-keys-gen
COPY --from=builder workspace/metrics/deploy/*rules*.yaml /ocs-prometheus-rules/
COPY --from=builder workspace/ux-backend-server /usr/local/bin/ux-backend-server
COPY --from=builder workspace/hack/entrypoint.sh /usr/local/bin/entrypoint

RUN chmod +x /usr/local/bin/ocs-operator /usr/local/bin/provider-api
RUN chmod +x /usr/local/bin/ocs-operator /usr/local/bin/provider-api /usr/local/bin/entrypoint

USER operator

ENTRYPOINT ["/usr/local/bin/ocs-operator"]
ENTRYPOINT ["/usr/local/bin/entrypoint"]
6 changes: 3 additions & 3 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ spec:
serviceAccountName: ocs-operator
containers:
- command:
- ocs-operator
- entrypoint
args:
- --enable-leader-election
- "--health-probe-bind-address=:8081"
- --enable-leader-election
- "--health-probe-bind-address=:8081"
image: ocs-dev/ocs-operator:latest
imagePullPolicy: Always
name: ocs-operator
Expand Down
2 changes: 1 addition & 1 deletion deploy/csv-templates/ocs-operator.csv.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ spec:
- --enable-leader-election
- --health-probe-bind-address=:8081
command:
- ocs-operator
- entrypoint
env:
- name: WATCH_NAMESPACE
valueFrom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ spec:
- --enable-leader-election
- --health-probe-bind-address=:8081
command:
- ocs-operator
- entrypoint
env:
- name: WATCH_NAMESPACE
valueFrom:
Expand Down
11 changes: 11 additions & 0 deletions hack/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

RESTART_EXIT_CODE=42

while true; do
./usr/local/bin/ocs-operator $@
EXIT_CODE=$?
if [ $EXIT_CODE -ne $RESTART_EXIT_CODE ]; then
exit $EXIT_CODE
fi
done

0 comments on commit 1d44aac

Please sign in to comment.