Skip to content
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

Document how to handle CRD/CR race condition #14

Closed
etsauer opened this issue Jun 5, 2020 · 2 comments · Fixed by #15
Closed

Document how to handle CRD/CR race condition #14

etsauer opened this issue Jun 5, 2020 · 2 comments · Fixed by #15
Labels
enhancement New feature or request

Comments

@etsauer
Copy link
Contributor

etsauer commented Jun 5, 2020

There is a race condition frequently created when deploying operators via OLM, where attempting to create the OperatorGroup and Subscription in the same oc apply command where the CR for that operator is also created, then the CRD for the operator hasn't yet been created. Since we don't directly create the CRD, we need to insert a conditional wait to ensure that the CRD exists before moving on.

It would also be nice if we could automate the detection of the CRDs we are waiting on, so we don't have to hardcode them in the workflow.

@etsauer etsauer added the enhancement New feature or request label Jun 5, 2020
@etsauer
Copy link
Contributor Author

etsauer commented Jun 5, 2020

Per @sabre1041 , here's an example command to insert between applying the OLM resources and the CR:

until oc wait --for condition=established --timeout=60s crd/argocds.argoproj.io; do sleep 2; done

@etsauer
Copy link
Contributor Author

etsauer commented Jun 8, 2020

@sabre1041 @gnekic @jkupferer what would you say to just using a general retry loop for the entire workflow:

until oc apply -Rf simple-bootstrap/ --prune -l example.com/project=simple-bootstrap; do sleep 2; done

etsauer added a commit to etsauer/declarative-openshift that referenced this issue Jun 9, 2020
sabre1041 pushed a commit that referenced this issue Jun 9, 2020
* Refactor docs to address #14, and add a gitops job

* Updated based on sabre1041's feedback

* Add ability to specify branch to clone

* Update prune whitelist

* Remove more deprecated apis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant