-
Notifications
You must be signed in to change notification settings - Fork 211
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
add raw string/multiline syntax to marker comments #446
Conversation
adds ability to specify a raw/multiline string in kube-openapi marker comments to make longer strings more ergonomic to use
@alexzielenski: GitHub didn't allow me to request PR reviews from the following users: Schnides123. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
d43d9d4
to
b1c8d4d
Compare
I'm okay with this as an approach. I haven't reviewed the implementation in detail. Since this is not API facing, I think we just need to get agreement on the go tag format internally. @thockin @deads2k do you have any thoughts on this format? It seems to me that it expands our go tag support to handle the cases we need to handle, and avoids the "super long oneline gotags" that kubebuilder suffers from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's going to be great to have this. Two minor comments then LGTM. I'd like to get one other lead to review the syntax, but I think it balances the tradeoffs well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a couple nits
LGTM once test issue is cleared (some kind of duplication)? |
581d5b6
to
ae3dc94
Compare
dont use go raw string literal when emitting generated code Then users can't use "`" in their strings. If we format with %#v it should escape everything as needed.
add comments
ae3dc94
to
f65ef9c
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexzielenski, Jefftree The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
// one time and all values are returned. Returns a map with an entry for | ||
// for each key and a value. | ||
// | ||
// Similar to version from gengo, but this version support only allows one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous paragraph says "A tag can be specified more than one time and all values are returned." but this says "only allows one value".
Am I misunderstanding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gah, that was missed when modifying the original comment.
The correct doc should read only one value per key. I'll correct that
adds ability to specify a raw/multiline string in kube-openapi marker comments to make longer strings more ergonomic to use
Syntax Example:
yields
key="validation line 2\nvalidation line 2"
Using
=
to specify multiple key-value pairs is now an error fork8s:validation
prefixed items. Lists must be specified using explicit indices/assign @Jefftree
/cc @Schnides123