github.com/operator-framework/operator-lifecycle-manager@v0.30.0/test/e2e/collect-ci-artifacts.sh (about)

     1  #! /bin/bash
     2  
     3  set -o pipefail
     4  set -o nounset
     5  set -o errexit
     6  
     7  : "${KUBECONFIG:?}"
     8  : "${TEST_NAMESPACE:?}"
     9  : "${TEST_ARTIFACTS_DIR:?}"
    10  : "${KUBECTL:=kubectl}"
    11  
    12  echo "Using the ${KUBECTL} kubectl binary"
    13  echo "Using the ${TEST_ARTIFACTS_DIR} output directory"
    14  mkdir -p "${TEST_ARTIFACTS_DIR}"
    15  
    16  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")
    23  commands+=("get events --sort-by .lastTimestamp")
    24  
    25  echo "Storing the test artifact output in the ${TEST_ARTIFACTS_DIR} directory"
    26  for command in "${commands[@]}"; do
    27      echo "Collecting ${command} output..."
    28      COMMAND_OUTPUT_FILE=${TEST_ARTIFACTS_DIR}/${command// /_}
    29      ${KUBECTL} -n ${TEST_NAMESPACE} ${command} >> "${COMMAND_OUTPUT_FILE}"
    30  done