Skip to content

Commit

Permalink
Enhance CI e2e-hub test reliability
Browse files Browse the repository at this point in the history
This change updates the CI e2e-hub test to wait for the `clusteradm join`
command to succeed asynchronously. Waiting for the latter synchronously
leads some times errors like the following:

```log
+ clusteradm join --hub-token *** --hub-apiserver \
    https://192.168.49.2:8443 --wait --cluster-name minikube
  Error: no matches for kind "Klusterlet" in version "operator.open-cluster-management.io/v1"
```

It also removes the unneeded `curl` installation. It also remove the
`apt-get upgrade` that could lead to more reliability issues on the CI
e2e steps.

open-cluster-management-io/clusteradm#334 (comment)

Signed-off-by: Michail Resvanis <mresvani@redhat.com>
  • Loading branch information
mresvanis committed May 10, 2023
1 parent 6b37e0a commit 8abb65c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ jobs:

steps:

- name: Install curl on the machine
run: sudo apt update -y && sudo apt upgrade -y && sudo apt install -y curl

- name: Checkout
uses: actions/checkout@v3

Expand Down
9 changes: 7 additions & 2 deletions ci/prow/e2e-hub-spoke-incluster-build
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@ hub_api_server=$(kubectl config view -o yaml | yq '.clusters[] | select(.. | .na
clusteradm join \
--hub-token ${token} \
--hub-apiserver ${hub_api_server} \
--wait \
--cluster-name ${MINIKUBE}

# Wait for the join command to succeed
kubectl wait --for=condition=Established crd managedclusters.cluster.open-cluster-management.io
timeout 60 sh -c "until kubectl get managedcluster ${MINIKUBE}; do sleep 2; done"
timeout 30 sh -c "until kubectl get csr -l open-cluster-management.io/cluster-name=${MINIKUBE} | grep Pending; do sleep 2; done"
timeout 1m bash -c "until kubectl get csr -l open-cluster-management.io/cluster-name=${MINIKUBE} -o json | jq -er \".items[].metadata.name\"; do sleep 2; done"
kubectl wait --for=condition=Available deployment/klusterlet-registration-agent -n open-cluster-management-agent
clusteradm accept --clusters ${MINIKUBE}

clusteradm accept --clusters ${MINIKUBE}

# Installing required addons to the hub/spoke clusters
clusteradm install hub-addon --names application-manager
Expand Down

0 comments on commit 8abb65c

Please sign in to comment.