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

Use pointer for HTTPPathMatch #564

Merged
merged 1 commit into from
Mar 9, 2021
Merged

Use pointer for HTTPPathMatch #564

merged 1 commit into from
Mar 9, 2021

Conversation

nak3
Copy link
Member

@nak3 nak3 commented Feb 22, 2021

What this PR does / why we need it:

Currently Path field in HTTPRoute is defined by non-pointer. It is not
consistent 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?:

NONE

Currently Path field in HTTPRoute is defined by non-pointer. It is not
consistent with `HTTPHeaderMatch` and hits an issue.
@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 22, 2021
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 22, 2021
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 22, 2021
@@ -337,7 +337,7 @@ type HTTPRouteMatch struct {
//
// +optional
// +kubebuilder:default={type: "Prefix", value: "/"}
Path HTTPPathMatch `json:"path,omitempty"`
Path *HTTPPathMatch `json:"path,omitempty"`
Copy link
Contributor

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.

@robscott
Copy link
Member

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.

@robscott
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 24, 2021
@robscott
Copy link
Member

robscott commented Mar 9, 2021

@danehans or @hbagdi did either of you get time to look into this? It does seem like we need to switch to a pointer here but I haven't had the time to verify yet myself.

@robscott
Copy link
Member

robscott commented Mar 9, 2021

Thanks @nak3! I've created #576 to track follow up on this so we can go ahead and get this in.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 9, 2021
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2021
@k8s-ci-robot k8s-ci-robot merged commit 45db501 into kubernetes-sigs:master Mar 9, 2021
@nak3 nak3 deleted the pointer-path branch June 7, 2021 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTPRouteMatch always requires Path field when creating HTTPRoute by API
4 participants