Skip to content

Commit

Permalink
This is a crude way of accounting for an existing namespace
Browse files Browse the repository at this point in the history
Running 'operator-sdk run bundle-upgrade' yielded this error:

Failed to run bundle upgrade: update catalog error: error in upgrading
FBC: error validating/stringifying the declarative config object:
error converting the declarative config to model: invalid package
\"trustify-operator\", channel \"operator-sdk-run-bundle\": duplicate
entry \"trustify-operator.v1.0.0-snapshot\"\n

Signed-off-by: Jim Crossley <[email protected]>
  • Loading branch information
jcrossley3 committed Oct 9, 2024
1 parent 5d56369 commit dfec951
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions hack/install-trustify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ 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}" || operator-sdk run bundle-upgrade "${OPERATOR_BUNDLE_IMAGE}" --namespace "${NAMESPACE}" --timeout "${TIMEOUT}" || (kubectl get Subscription --namespace "${NAMESPACE}" -o yaml && exit 1)

# delete the ns if it exists, effectively undeploying the current
# Trustify instance. This kinda defeats the purpose of operators,
# obviously, but I'm not familiar enough with the operator-sdk
# command to convince it to reinstall/upgrade the bundle -- run
# bundle-upgrade didn't work :(
kubectl delete namespace ${NAMESPACE} || true

kubectl create namespace ${NAMESPACE}
operator-sdk run bundle "${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

0 comments on commit dfec951

Please sign in to comment.