Skip to content

Commit 0924ef3

Browse files
committed
Update ci artifact collection
Signed-off-by: perdasilva <[email protected]>
1 parent c610a3e commit 0924ef3

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM quay.io/fedora/fedora:34-x86_64 as builder
22
LABEL stage=builder
33
WORKDIR /build
44

5-
# install dependencies and go 1.16
5+
# install dependencies and go 1.17
66

77
# copy just enough of the git repo to parse HEAD, used to record version in OLM binaries
88
RUN dnf update -y && dnf install -y bash make git mercurial jq wget && dnf upgrade -y

test/e2e/collect-ci-artifacts.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,22 @@ echo "Using the ${KUBECTL} kubectl binary"
1313
echo "Using the ${TEST_ARTIFACTS_DIR} output directory"
1414
mkdir -p "${TEST_ARTIFACTS_DIR}"
1515

16+
OLM_RESOURCES="csv,sub,catsrc,installplan"
17+
1618
commands=()
17-
commands+=("get catalogsources -o yaml")
18-
commands+=("get subscriptions -o yaml")
19-
commands+=("get operatorgroups -o yaml")
20-
commands+=("get clusterserviceversions -o yaml")
21-
commands+=("get installplans -o yaml")
22-
commands+=("get pods -o wide")
19+
commands+=("describe all,${OLM_RESOURCES}")
20+
commands+=("get all,${OLM_RESOURCES} -o yaml")
21+
commands+=("get all,${OLM_RESOURCES} -o wide")
2322
commands+=("get events --sort-by .lastTimestamp")
2423

2524
echo "Storing the test artifact output in the ${TEST_ARTIFACTS_DIR} directory"
2625
for command in "${commands[@]}"; do
2726
echo "Collecting ${command} output..."
2827
COMMAND_OUTPUT_FILE=${TEST_ARTIFACTS_DIR}/${command// /_}
29-
${KUBECTL} -n ${TEST_NAMESPACE} ${command} >> "${COMMAND_OUTPUT_FILE}"
28+
${KUBECTL} -n "${TEST_NAMESPACE}" "${command}" >> "${COMMAND_OUTPUT_FILE}"
29+
done
30+
31+
for pod in $(${KUBECTL} -n "${TEST_NAMESPACE}" get --no-headers pods | awk '{ print $1 }'); do
32+
echo "Collecting logs for pod: ${pod}"
33+
${KUBECTL} -n "${TEST_NAMESPACE}" logs "${pod}" >> "${TEST_ARTIFACTS_DIR}/${pod}.log"
3034
done

0 commit comments

Comments
 (0)