Skip to content

Commit

Permalink
Update test-prow-e2e.sh
Browse files Browse the repository at this point in the history
+ Dump CustomResourceDefinition $ARTIFACT_DIR
+ Add more debug steps for openshift ci

Signed-off-by: Rabin Yasharzadehe <[email protected]>
  • Loading branch information
rabin-io committed Dec 18, 2024
1 parent c119a2b commit 9905ddf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
17 changes: 14 additions & 3 deletions deploy-kubevirt-gating.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

export ON_CI="ON_CI"

pause_for_debug()
{
if [[ ${OPENSHIFT_CI} == 'true' ]]; then
echo " 🐛 Pause and give time to debug the issue"
sleep 7000
fi
}

# Wait until master and worker MCP are updated
# or timeout after 90min.
wait_mcp_for_updated()
Expand Down Expand Up @@ -29,6 +37,7 @@ wait_mcp_for_updated()

download_virtctl()
{
#VIRTCTL_LATEST=$(curl -fsSL -H 'Accept: application/json' https://github.com/kubevirt/kubevirt/releases/latest | jq -r '.tag_name' | tr -d 'v')
VIRTCTL_DOWNLOAD_URL="https://github.com/kubevirt/kubevirt/releases/download/${VIRTCTL_VERSION}/virtctl-${VIRTCTL_VERSION}"
VIRTCTL_X86_64="${VIRTCTL_DOWNLOAD_URL}-linux-x86_64"
VIRTCTL_AMD64="${VIRTCTL_DOWNLOAD_URL}-linux-amd64"
Expand All @@ -53,7 +62,7 @@ export HCO_SUBSCRIPTION_CHANNEL=${HCO_SUBSCRIPTION_CHANNEL:-"candidate-v1.11"}
export VIRTCTL_VERSION="v1.0.1"
export HPP_VERSION="release-v0.18"

cat <<EOF | oc apply -f -
tee <<EOF | oc apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
Expand All @@ -66,7 +75,7 @@ spec:
publisher: Kubevirt Project
EOF

cat <<EOF | oc apply -f -
tee <<EOF | oc apply -f -
apiVersion: v1
kind: Namespace
metadata:
Expand Down Expand Up @@ -116,6 +125,7 @@ done

if [[ "$hco_cr_is_created" == "false" ]]; then
echo "Error: HCO cr didn't get created!!"
pause_for_debug
exit 1
fi

Expand All @@ -137,6 +147,7 @@ done

if [[ "$virt_operator_is_available" == "false" ]]; then
echo "Error: virt-operator is not available!!"
pause_for_debug
exit 1
fi

Expand All @@ -153,7 +164,7 @@ wait_mcp_for_updated
oc create -f \
https://raw.githubusercontent.com/kubevirt/hostpath-provisioner-operator/${HPP_VERSION}/deploy/hostpathprovisioner_cr.yaml

cat <<EOF | oc apply -f -
tee <<EOF | oc apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
Expand Down
1 change: 1 addition & 0 deletions test-prow-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function generateLogsAndCopyArtifacts {
oc cluster-info dump > ${ARTIFACT_DIR}/cluster_info.json
oc get catalogsource -A -o wide > ${ARTIFACT_DIR}/catalogsource.yaml
oc get catalogsource -A -o yaml >> ${ARTIFACT_DIR}/catalogsource.yaml
oc get CustomResourceDefinition -o yaml > ${ARTIFACT_DIR}/CustomResourceDefinition.yaml
oc get subscriptions -n ${NS} -o wide > ${ARTIFACT_DIR}/subscription_details.yaml
oc get subscriptions -n ${NS} -o yaml >> ${ARTIFACT_DIR}/subscription_details.yaml
oc get csvs -n ${NS} -o wide > ${ARTIFACT_DIR}/csvs.yaml
Expand Down

0 comments on commit 9905ddf

Please sign in to comment.