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 9, 2023
1 parent 6b37e0a commit 4a0c787
Show file tree
Hide file tree
Showing 2 changed files with 6 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
8 changes: 6 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,15 @@ 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 "while ! kubectl get managedcluster ${MINIKUBE} >/dev/null 2>&1; do sleep 2; done"
timeout 30 sh -c "while ! kubectl get csr -l open-cluster-management.io/cluster-name=${MINIKUBE} 2> /dev/null | grep Pending >/dev/null 2>&1; 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 4a0c787

Please sign in to comment.