Skip to content

Commit

Permalink
Adding wait after olm install in olm test setup
Browse files Browse the repository at this point in the history
Signed-off-by: frherrer <frherrer@redhat.com>

Adding sleep

Signed-off-by: frherrer <frherrer@redhat.com>

Adding timout to wait in olm setup

Signed-off-by: frherrer <frherrer@redhat.com>

Delete sleep

Signed-off-by: frherrer <frherrer@redhat.com>

Adding more debug information

Signed-off-by: frherrer <frherrer@redhat.com>

Adding more debug information when operator-sdk fails

Signed-off-by: frherrer <frherrer@redhat.com>

Fix label on wait condition

Signed-off-by: frherrer <frherrer@redhat.com>

Change wait condition for catalogSource

Signed-off-by: frherrer <frherrer@redhat.com>

Delete comment

Signed-off-by: frherrer <frherrer@redhat.com>

Improve wait for catalogSource

Signed-off-by: frherrer <frherrer@redhat.com>
  • Loading branch information
fjglira committed Sep 24, 2024
1 parent bd6e048 commit 7a90766
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 @@ -234,10 +234,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 7a90766

Please sign in to comment.