Skip to content

Commit

Permalink
🌱 improve install-konveyor debug (#372)
Browse files Browse the repository at this point in the history
Signed-off-by: David Zager <[email protected]>
  • Loading branch information
djzager authored Aug 1, 2024
1 parent 9d41c5a commit 2a4a88f
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .github/actions/install-konveyor/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ runs:
run: make install-konveyor
working-directory: ${{ github.action_path }}/../../..
shell: bash
- name: Upload logs on fail
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: debug-output
path: /tmp/konveyor-debug
14 changes: 14 additions & 0 deletions .github/actions/make-bundle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ inputs:
description: "comma separated channel(s) this operator should be available on"
required: false
default: ""
push_bundle:
description: ""
required: false
default: "false"

runs:
using: "composite"
steps:
Expand Down Expand Up @@ -85,3 +90,12 @@ runs:
make bundle-build
working-directory: ${{ github.action_path }}/../../..
shell: bash

- name: Push bundle
if: ${{ inputs.push_bundle == 'true' }}
env:
BUNDLE_IMG: ${{ inputs.operator_bundle }}
run: |
make bundle-push
working-directory: ${{ github.action_path }}/../../..
shell: bash
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ catalog-push: ## Push a catalog image.

.PHONY: start-minikube
start-minikube:
$(shell pwd)/hack/start-minikube.sh
bash hack/start-minikube.sh

.PHONY: install-tackle
install-tackle:
$(shell pwd)/hack/install-tackle.sh
bash hack/install-tackle.sh

.PHONY: install-konveyor
install-konveyor:
$(shell pwd)/hack/install-konveyor.sh
bash hack/install-konveyor.sh

YQ = $(shell pwd)/bin/yq
.PHONY: yq
Expand Down
40 changes: 31 additions & 9 deletions hack/install-konveyor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,41 @@ if ! command -v operator-sdk >/dev/null 2>&1; then
fi

debug() {
set +e
echo "Install Konveyor FAILED!!!"
echo "What follows is some info that may be useful in debugging the failure"

kubectl get namespace "${NAMESPACE}" -o yaml || true
kubectl get --namespace "${NAMESPACE}" all || true
kubectl get --namespace "${NAMESPACE}" -o yaml \
subscriptions.operators.coreos.com,catalogsources.operators.coreos.com,installplans.operators.coreos.com,clusterserviceversions.operators.coreos.com \
|| true
kubectl get --namespace "${NAMESPACE}" -o yaml tackles.tackle.konveyor.io/tackle || true
if [ "${CI}" == "true" ]; then
debug_output="/tmp/konveyor-debug"
mkdir -p "${debug_output}"
namespace="${debug_output}/namespace.yaml"
all="${debug_output}/all_resources.yaml"
operator="${debug_output}/operator_resources.yaml"
tackle="${debug_output}/tackle.yaml"
pods="${debug_output}/pod_descriptions.yaml"

kubectl get namespace "${NAMESPACE}" -o yaml | tee "${namespace}"
kubectl get --namespace "${NAMESPACE}" all | tee "${all}"
kubectl get --namespace "${NAMESPACE}" -o yaml \
subscriptions.operators.coreos.com,catalogsources.operators.coreos.com,installplans.operators.coreos.com,clusterserviceversions.operators.coreos.com | tee "${operator}"
kubectl get --namespace "${NAMESPACE}" -o yaml tackles.tackle.konveyor.io/tackle | tee "${tackle}"

for pod in $(kubectl get pods -n "${NAMESPACE}" -o jsonpath='{.items[*].metadata.name}'); do
kubectl --namespace "${NAMESPACE}" describe pod "${pod}" | tee -a "${pods}"
kubectl --namespace "${NAMESPACE}" logs "${pod}" | tee "${debug_output}/${pod}.log"
done
else
kubectl get namespace "${NAMESPACE}" -o yaml
kubectl get --namespace "${NAMESPACE}" all
kubectl get --namespace "${NAMESPACE}" -o yaml \
subscriptions.operators.coreos.com,catalogsources.operators.coreos.com,installplans.operators.coreos.com,clusterserviceversions.operators.coreos.com
kubectl get --namespace "${NAMESPACE}" -o yaml tackles.tackle.konveyor.io/tackle

for pod in $(kubectl get pods -n "${NAMESPACE}" -o jsonpath='{.items[*].metadata.name}'); do
kubectl --namespace "${NAMESPACE}" describe pod "${pod}"
done
fi

for pod in $(kubectl get pods -n "${NAMESPACE}" -o jsonpath='{.items[*].metadata.name}'); do
kubectl --namespace "${NAMESPACE}" describe pod "${pod}" || true
done
exit 1
}
trap 'debug' ERR
Expand Down

0 comments on commit 2a4a88f

Please sign in to comment.