Closed zach-source closed 4 months ago
@zach-source this looks great - do you have an example of how to reference a status condition with a specific type
in a CEL query? I have been looking at CEL examples and I haven't found an equivalent syntax to the JSONPath $.status.conditions[?(@.type=="Completed")].status
syntax.
@zach-source this looks great - do you have an example of how to reference a status condition with a specific
type
in a CEL query? I have been looking at CEL examples and I haven't found an equivalent syntax to the JSONPath$.status.conditions[?(@.type=="Completed")].status
syntax.
I think I figured it out:
status.conditions.exists(w, w.type=='Foo' && w.status == 'True')
Ah yea, exactly. And you can combine them if you want multiple. I've pushed up changes to make it pass all the reviewable checks. It's been a minute since I worked on a provider and I always have a hard time getting that submodule to sync correctly. You can see the list of all the available macros here: https://github.com/google/cel-spec/blob/master/doc/langdef.md#macros
I'll add a test case for ya.
@zach-source Please run go mod tidy
and make generate
and commit the results.
Should be good to go now @bobh66
@turkenh can you take a look at this? It would be great to get this into the next release if possible - thanks!
Looking good! A few minor comments
Thanks for the review - I'll do a bit of work on it this weekend and push it up. Probably tomorrow.
@phisco comments have been addressed.
@phisco Added your recommended changes/nits.
Description of your changes
Adds new readiness policy called "DeriveFromCelQuery". This policy allows the use of a cel query to check if an object is ready. This is handy to check conditions on objects with non-standard methods of determining if it ready such as the argocd applictation object.
Probably closes https://github.com/crossplane-contrib/provider-kubernetes/issues/192
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
I've written several test caes that cover the usage of the new feature.