diff --git a/.pipelines/e2e.yml b/.pipelines/e2e.yml index 068d2b60df1..84982ac6078 100644 --- a/.pipelines/e2e.yml +++ b/.pipelines/e2e.yml @@ -81,8 +81,16 @@ jobs: - script: | export CI=true + # . secrets/env . ./hack/e2e/run-rp-and-e2e.sh + set -x + # set up jq + wget -nv https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 + mv jq-linux64 jq + chmod +x jq + + # retrieve the kubeconfig and oc cli hack/get-admin-kubeconfig.sh /subscriptions/$AZURE_SUBSCRIPTION_ID/resourceGroups/$CLUSTER/providers/Microsoft.RedHatOpenShift/openShiftClusters/$CLUSTER >admin.kubeconfig displayName: Get admin kubeconfig for must-gather condition: failed() @@ -90,10 +98,11 @@ jobs: - script: | export CI=true . ./hack/e2e/run-rp-and-e2e.sh + export KUBECONFIG=admin.kubeconfig + wget -nv https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/4.10.20/openshift-client-linux-4.10.20.tar.gz + tar xf openshift-client-linux-4.10.20.tar.gz - wget -nv https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/$(OpenShiftVersion)/openshift-client-linux-$(OpenShiftVersion).tar.gz - tar xf openshift-client-linux-$(OpenShiftVersion).tar.gz ./oc adm must-gather tar cf must-gather.tar.gz must-gather.local.* displayName: Collect must-gather diff --git a/hack/get-admin-kubeconfig.sh b/hack/get-admin-kubeconfig.sh index cb97ff3cd60..ea32110adc8 100755 --- a/hack/get-admin-kubeconfig.sh +++ b/hack/get-admin-kubeconfig.sh @@ -6,7 +6,7 @@ if [[ "$#" -ne 1 ]]; then fi if [[ $CI ]]; then - ./db "$1" | jq -r .openShiftCluster.properties.adminKubeconfig | base64 -d | sed -e 's|https://api-int\.|https://api\.|' + ./db "$1" | ./jq -r .openShiftCluster.properties.adminKubeconfig | base64 -d | sed -e 's|https://api-int\.|https://api\.|' else - go run ./hack/db "$1" | jq -r .openShiftCluster.properties.adminKubeconfig | base64 -d | sed -e 's|https://api-int\.|https://api\.|' + go run ./hack/db "$1" | ./jq -r .openShiftCluster.properties.adminKubeconfig | base64 -d | sed -e 's|https://api-int\.|https://api\.|' fi