diff --git a/Dockerfile b/Dockerfile index cc6352e9..de14b4db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/bundle/manifests/ocs-client-operator.clusterserviceversion.yaml b/bundle/manifests/ocs-client-operator.clusterserviceversion.yaml index c99def39..39deab88 100644 --- a/bundle/manifests/ocs-client-operator.clusterserviceversion.yaml +++ b/bundle/manifests/ocs-client-operator.clusterserviceversion.yaml @@ -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. @@ -774,7 +774,7 @@ spec: - --leader-elect - --console-port=9001 command: - - /manager + - /entrypoint env: - name: OPERATOR_NAMESPACE valueFrom: diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 52ac5c5d..f6fcb9c1 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -41,7 +41,7 @@ spec: fieldPath: metadata.namespace containers: - command: - - /manager + - /entrypoint args: - --leader-elect image: controller:latest diff --git a/hack/entrypoint.sh b/hack/entrypoint.sh new file mode 100755 index 00000000..bc58ad14 --- /dev/null +++ b/hack/entrypoint.sh @@ -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