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

Improve CEL message #274

Merged
merged 2 commits into from
Sep 11, 2023
Merged

Improve CEL message #274

merged 2 commits into from
Sep 11, 2023

Conversation

lsviben
Copy link
Contributor

@lsviben lsviben commented Sep 7, 2023

Description of your changes

Improves the message for toplevel CEL rules, noting the full path of the field.
Also fixes the issue where initProvider would be mentioned in the CEL message due to it
not being set.

Fixes #273

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • [] Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Tested with the example from #273 .

Initial result:

The EventHub "example-eventhub" is invalid:
* spec: Invalid value: "object": no such key: initProvider evaluating rule: messageRetention is a required parameter
* spec: Invalid value: "object": no such key: initProvider evaluating rule: partitionCount is a required parameter

After applying the change:

The EventHub "example-eventhub" is invalid: 
* spec: Invalid value: "object": spec.forPovider.messageRetention is a required parameter
* spec: Invalid value: "object": spec.forPovider.partitionCount is a required parameter

Copy link
Member

@turkenh turkenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix @lsviben 🙌

@lsviben lsviben merged commit 0154ca2 into crossplane:main Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misleading error pointing to spec.initProvider when required parameters are not provided
2 participants