-
Notifications
You must be signed in to change notification settings - Fork 234
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
Allow configurable tag name overrides in native types #1009
Allow configurable tag name overrides in native types #1009
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Hi @matthchr, thanks for the contribution. Would you mind signing the CLA? I'll try to give this a review by the end of the week. /gcbrun |
I've signed the CLA. Let me know if you have any questions as well - I'm happy to talk through our use-case. I had originally done a different approach, something like this:
that users could configure, before I realized that actually all I really needed was to be able to configure the tag to parse for the feature that already existed, because what I wanted to do was use JSON tags rather than a new CEL tag. |
5cb248c
to
991d75d
Compare
/gcbrun |
Allowing tags other than "cel" enables more flexibility, particularly when the types in question aren't owned by those configuring the CEL environment. The main use-case for this is enabling an experience in CEL that matches the shape of an object in JSON (or YAML). This includes: - Property casing: 'Property' in Go would likely be 'property' in JSON/YAML. - Embedded structures: metav1.ObjectType `json:"metadata,omitempty"` is common on Kuberentes resources, allowing users to request CEL use the JSON tags enables access via the ".metadata" property even though there is no such property on the actual Native type.
991d75d
to
f0b814d
Compare
/gcbrun |
Thanks for merging! |
Allowing tags other than "cel" enables more flexibility, particularly when the types in question aren't owned by those configuring the CEL environment.
The main use-case for this is enabling an experience in CEL that matches the shape of an object in JSON (or YAML). This includes:
json:"metadata,omitempty"
is common on Kuberentes resources, allowing users to request CEL use the JSON tags enables access via the ".metadata" property even though there is no such property on the actual Native type.Reviews
Merging
they have write access. Otherwise, the change will be merged by a maintainer.
closes #<issue-num>: description
in the merge message,if applicable.