-
Notifications
You must be signed in to change notification settings - Fork 61
Remove waiting loops for kubernetes resources from Makefile #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove waiting loops for kubernetes resources from Makefile #189
Conversation
/retest |
/retest |
1 similar comment
/retest |
.github/workflows/olm_tests.yaml
Outdated
@@ -73,6 +73,13 @@ jobs: | |||
sleep 1 | |||
kubectl create -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${OLM_VERSION}/olm.yaml | |||
|
|||
- name: Wait for default CatalogSource to start | |||
run: | | |||
make wait-for-catalog-source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you feel strong about defining the wait logic in the Makefile? I understand it may be to factorize the logic, but it's really a one-liner, and would make the test workflow easier to read.
Also I think kubectl wait
supports --for=jsonpath
, so instead of:
$ timeout 120 bash -c 'while [[ "$$(kubectl get catalogsource/'$(CATALOG_SOURCE_NAME)' -n '$(CATALOG_SOURCE_NAMESPACE)' -o json | jq -r .status.connectionState.lastObservedState)" != "READY" ]]; do sleep 5 && echo "$$(kubectl get catalogsource/'$(CATALOG_SOURCE_NAME)' -n '$(CATALOG_SOURCE_NAMESPACE)' -o json | jq -r .status.connectionState.lastObservedState)" ; done'
This could be:
$ kubectl wait -n ${CATALOG_SOURCE_NAMESPACE} catalogsource/'${CATALOG_SOURCE_NAME} --for=jsonpath='{.status.connectionState.lastObservedState}'=READY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will refactor.
/lgtm /approve |
/lgtm /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: astefanutti The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #188