Skip to content

Commit

Permalink
Adding wait after olm install in olm test setup (#357)
Browse files Browse the repository at this point in the history
Adding sleep



Adding timout to wait in olm setup



Delete sleep



Adding more debug information



Adding more debug information when operator-sdk fails



Fix label on wait condition



Change wait condition for catalogSource



Delete comment



Improve wait for catalogSource

Signed-off-by: frherrer <frherrer@redhat.com>
  • Loading branch information
fjglira authored Sep 24, 2024
1 parent ab57cdf commit 005d1c3
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/e2e/common-operator-integ-suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,27 @@ if [ "${SKIP_BUILD}" == "false" ]; then
# Install OLM in the cluster because it's not available by default in kind.
${OPERATOR_SDK} olm install

# Wait for for the CatalogSource to be CatalogSource.status.connectionState.lastObservedState == READY
${COMMAND} wait catalogsource operatorhubio-catalog -n olm --for 'jsonpath={.status.connectionState.lastObservedState}=READY' --timeout=5m

# Create operator namespace
${COMMAND} create ns "${NAMESPACE}" || echo "Creation of namespace ${NAMESPACE} failed with the message: $?"
# Deploy the operator using OLM
${OPERATOR_SDK} run bundle "${BUNDLE_IMG}" -n "${NAMESPACE}" --skip-tls --timeout 5m
${OPERATOR_SDK} run bundle "${BUNDLE_IMG}" -n "${NAMESPACE}" --skip-tls --timeout 5m || {
echo "****** run bundle failed, running debug information"
# Get all the pods in the namespace
${COMMAND} get pods -n "${NAMESPACE}"

# Get all the pods in olm namespace
${COMMAND} get pods -n olm

# Describe all the olm pods by iterating over the pods
for pod in $(${COMMAND} get pods -n olm -o name); do
echo "*** Describing pod: ${pod}"
${COMMAND} describe "${pod}"
done
exit 1
}

# Wait for the operator to be ready
${COMMAND} wait --for=condition=available deployment/"${DEPLOYMENT_NAME}" -n "${NAMESPACE}" --timeout=5m
Expand Down

0 comments on commit 005d1c3

Please sign in to comment.