-
Notifications
You must be signed in to change notification settings - Fork 490
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
Use pointer for HTTPPathMatch #564
Conversation
Currently Path field in HTTPRoute is defined by non-pointer. It is not consistent with `HTTPHeaderMatch` and hits an issue.
Hi @nak3. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
@@ -337,7 +337,7 @@ type HTTPRouteMatch struct { | |||
// | |||
// +optional | |||
// +kubebuilder:default={type: "Prefix", value: "/"} | |||
Path HTTPPathMatch `json:"path,omitempty"` | |||
Path *HTTPPathMatch `json:"path,omitempty"` |
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.
Interesting. HTTPHeaderMatch
is a pointer because there is no default value for it. This was not a pointer because this couldn't have a nil
value since it has a default.
Thanks for this PR @nak3! We discussed this at today's community meeting and realized this was a bit more complicated than I initially thought. It seems like we'll probably need to change all references to optional structs in this API to pointers if this pattern applies broadly. Before we do that, we want to make sure we're completely understanding why this is happening for requests from client-go but not kubectl. If you (or anyone) are able to try creating the same resource with a yaml manifest, I'd like to confirm that is working for the same config client-go is failing with. This does feel like a significant issue and a gap in our testing, I just want to make sure that we're correctly understanding the scope and solution here. |
/ok-to-test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nak3, robscott 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 |
What this PR does / why we need it:
Currently
Path
field inHTTPRoute
is defined by non-pointer. It is notconsistent with
HTTPHeaderMatch
and hits an issue like #563.Hence this patch changes to use pointer for HTTPPathMatch.
What type of PR is this?
/kind cleanup
Which issue(s) this PR fixes:
Fixes #563
Does this PR introduce a user-facing change?: