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

Fix reserved keyword escape example in CEL #47382

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ivan-Roger
Copy link
Contributor

Description

Add the missing escaped property name for the reserved keywords example in the CEL escape sequences examples table.

Add the missing escaped property name for the reserved keywords example in the CEL escape sequences examples table.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. language/en Issues or PRs related to English language labels Aug 7, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign katcosgrove for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

netlify bot commented Aug 7, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit a3b1aec
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/66b39b7f8905df0008fba007
😎 Deploy Preview https://deploy-preview-47382--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

| `namespace` | `self.__namespace__ > 0` |
| `x-prop` | `self.x__dash__prop > 0` |
| `redact__d` | `self.redact__underscores__d > 0` |
| `string` | `self.__{string}__.startsWith('kube')` |
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't escape string as field name. I don't understand this change..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I believe it is what was meant to be done in the first place. An example on how to escape reserved keywords...

The current example doesn't really make sense, does-it ?

Copy link
Contributor

Choose a reason for hiding this comment

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

How about dropping the line:

| `string`      | `self.startsWith('kube')`         |

entirely?

Copy link
Contributor Author

@Ivan-Roger Ivan-Roger Aug 8, 2024

Choose a reason for hiding this comment

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

I believe this would be a shame as an example makes it clear how reserved keywords should be escaped.
Could we get feedback from someone who knows how CEL escape sequences work and make sure the example is correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

#47382 (comment)

@cici37 knows a thing or two!

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm in favor of having tests in code that match all examples given here. That way if there is any disagreement about how the system behaves, we have direct evidence of what the actual behavior is.

@sftim
Copy link
Contributor

sftim commented Sep 27, 2024

@kubernetes/sig-api-machinery-pr-reviews please take a look

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants