Skip to content

Commit

Permalink
hack - try to install jq, oc, cat the kubeconfig
Browse files Browse the repository at this point in the history
try target: container

set up jq inside the container

try to fix the jq alias

shopt, set -x

hack - set up jq, az, cat the kubeconfig
  • Loading branch information
cadenmarchese committed Jul 18, 2023
1 parent 2730404 commit a266e40
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
24 changes: 21 additions & 3 deletions .pipelines/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,35 @@ jobs:
- script: |
export CI=true
# set up az
az account set -s $AZURE_SUBSCRIPTION_ID
SECRET_SA_ACCOUNT_NAME=e2earosecrets make secrets
. 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
export KUBECONFIG=admin.kubeconfig
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
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
# test the kubeconfig and collect the gather
cat admin.kubeconfig
./oc get pods
./oc get nodes
./oc get cluster cluster -o yaml
./oc adm must-gather
tar cf must-gather.tar.gz must-gather.local.*
displayName: Collect must-gather
condition: failed()
target: container
- publish: must-gather.tar.gz
artifact: must-gather
displayName: Append must-gather to Pipeline
Expand Down
1 change: 0 additions & 1 deletion .pipelines/vars.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
variables:
GOPATH: $(Agent.BuildDirectory)/go
OpenShiftVersion: 4.10.20
ARO_CHECKOUT_PATH: $(Agent.BuildDirectory)/go/src/github.com/Azure/ARO-RP
4 changes: 2 additions & 2 deletions hack/get-admin-kubeconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a266e40

Please sign in to comment.