Skip to content

Commit

Permalink
controllers: 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: Rewant Soni <[email protected]>
Signed-off-by: raaizik <[email protected]>
  • Loading branch information
rewantsoni committed Oct 7, 2024
1 parent e072225 commit 2e71a57
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ WORKDIR /
COPY --from=builder /workspace/bin/manager .
COPY --from=builder /workspace/bin/status-reporter .
COPY --from=builder /workspace/bin/deployment-guard .
COPY --from=builder /workspace/hack/entrypoint.sh entrypoint
USER 65532:65532

ENTRYPOINT ["/manager"]
ENTRYPOINT ["/entrypoint"]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
categories: Storage
console.openshift.io/plugins: '["odf-client-console"]'
containerImage: quay.io/ocs-dev/ocs-client-operator:latest
createdAt: "2024-09-24T09:48:54Z"
createdAt: "2024-10-07T10:43:06Z"
description: OpenShift Data Foundation client operator enables consumption of
storage services from a remote centralized OpenShift Data Foundation provider
cluster.
Expand Down Expand Up @@ -774,7 +774,7 @@ spec:
- --leader-elect
- --console-port=9001
command:
- /manager
- /entrypoint
env:
- name: OPERATOR_NAMESPACE
valueFrom:
Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
fieldPath: metadata.namespace
containers:
- command:
- /manager
- /entrypoint
args:
- --leader-elect
image: controller:latest
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 2e71a57

Please sign in to comment.