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

[gwctl] Expand the output of gwctl describe httproute #3071

Closed

Conversation

tdn21
Copy link
Contributor

@tdn21 tdn21 commented May 10, 2024

What type of PR is this?
/kind gep

What this PR does / why we need it:
This PR introduces an expansion in the output of gwctl describe httproute/httproutes as per the expectation of this GEP.

Which issue(s) this PR fixes:

Fixes #3037

Does this PR introduce a user-facing change?:

The output of `gwctl describe httproute <NAME>` is enhanced further.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/gep PRs related to Gateway Enhancement Proposal(GEP) labels May 10, 2024
Copy link

linux-foundation-easycla bot commented May 10, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@tdn21 tdn21 marked this pull request as draft May 10, 2024 09:41
@k8s-ci-robot
Copy link
Contributor

Welcome @tdn21!

It looks like this is your first PR to kubernetes-sigs/gateway-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 10, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @tdn21. 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 10, 2024
@gauravkghildiyal
Copy link
Member

/assign

Thanks @tdn21, this seems to be shaping up well. Will do a more detailed review once we take care of the clarifications provided in #3037 (comment)

Thanks for contributing!

@gauravkghildiyal
Copy link
Member

Hi @tdn21! Did you get a chance to make the necessary updates?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 15, 2024
@tdn21
Copy link
Contributor Author

tdn21 commented May 23, 2024

@gauravkghildiyal, sincere apologies for not getting to this last week. I will update the PR this weekend or upcoming week. Thank you for your patience. 🙇

@tdn21 tdn21 force-pushed the issue-3307/gwctl-describe-httproutes branch from a90956b to c85eaa1 Compare June 1, 2024 23:41
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 1, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tdn21
Once this PR has been reviewed and has the lgtm label, please ask for approval from gauravkghildiyal. 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

@tdn21 tdn21 force-pushed the issue-3307/gwctl-describe-httproutes branch from c85eaa1 to 047e7de Compare June 1, 2024 23:45
@tdn21 tdn21 marked this pull request as ready for review June 1, 2024 23:54
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 1, 2024
@tdn21
Copy link
Contributor Author

tdn21 commented Jun 1, 2024

@gauravkghildiyal thank you for waiting and please take a look whenever you get some time.


// calculateInheritedPolicies calculates the inherited polices for all
// Gateways, HTTRoutes, and Backends in ResourceModel.
func (rm *ResourceModel) calculateInheritedPolicies() error {
Copy link
Member

Choose a reason for hiding this comment

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

Can we add some unit tests for this?

}

// mergePolicyMaps merges the source map into the destination map.
func mergePolicyMaps(dest, src map[policyID]*PolicyNode) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we use maps.Copy(): https://pkg.go.dev/maps@go1.22.2#Copy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, thanks for pointing it out. 🙇
Let me update the PR.

fmt.Fprint(hp, string(b))

for _, policyNode := range httpRouteNode.InheritedPolicies {
policyNamespace := handleDefaultNamespace(policyNode.Policy.Unstructured().GetNamespace())
Copy link
Member

Choose a reason for hiding this comment

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

Two things:

  • I don't think you need handleDefaultNamespace to normalize. It's only useful in unit tests and I'd rather prefer us adding the namespace to the resource manually when creating it. Resources in real context should always have namespace
  • This is also error prone for cases where the policy is a cluster-scoped resource (so it will not have a namespace and "default" is incorrect in such a case). You may need to handle that

@gauravkghildiyal
Copy link
Member

Hi @tdn21! Were you able to make some progress here?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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-sigs/prow repository.

@gauravkghildiyal
Copy link
Member

Hi @tdn21

We'd like to get this in soon, so I've rebased the commits from this PR and built on top of these commits in #3181.

/close

@k8s-ci-robot
Copy link
Contributor

@gauravkghildiyal: Closed this PR.

In response to this:

Hi @tdn21

We'd like to get this in soon, so I've rebased the commits from this PR and built on top of these commits in #3181.

/close

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gwctl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/gep PRs related to Gateway Enhancement Proposal(GEP) needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expand output for gwctl describe httproutes
3 participants