Skip to content

Commit

Permalink
Attempt to upgrade bundle if install fails before exiting
Browse files Browse the repository at this point in the history
Also avoid filling up the logs with other installed operators,
e.g. grafana.

Signed-off-by: Jim Crossley <[email protected]>
  • Loading branch information
jcrossley3 committed Oct 9, 2024
1 parent 1c2f893 commit 5d56369
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions hack/install-trustify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fi
run_bundle() {
kubectl auth can-i create namespace --all-namespaces
kubectl create namespace ${NAMESPACE} || true
operator-sdk run bundle "${OPERATOR_BUNDLE_IMAGE}" --namespace "${NAMESPACE}" --timeout "${TIMEOUT}" || (kubectl get Subscription --namespace "${NAMESPACE}" -o yaml && exit 1)
operator-sdk run bundle "${OPERATOR_BUNDLE_IMAGE}" --namespace "${NAMESPACE}" --timeout "${TIMEOUT}" || operator-sdk run bundle-upgrade "${OPERATOR_BUNDLE_IMAGE}" --namespace "${NAMESPACE}" --timeout "${TIMEOUT}" || (kubectl get Subscription --namespace "${NAMESPACE}" -o yaml && exit 1)

# If on MacOS, need to install `brew install coreutils` to get `timeout`
timeout 600s bash -c 'until kubectl get customresourcedefinitions.apiextensions.k8s.io trustifies.org.trustify; do sleep 30; done' \
Expand Down Expand Up @@ -80,8 +80,6 @@ EOF
--field-selector=status.phase!=Running \
-o yaml \
pods # Print not running trustify pods when timed out

kubectl get deployments.apps -n "${NAMESPACE}" -o yaml
}

# Available versions of OLM here https://github.com/operator-framework/operator-lifecycle-manager/releases
Expand Down

0 comments on commit 5d56369

Please sign in to comment.