-
Notifications
You must be signed in to change notification settings - Fork 480
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
[gwctl] Expand the output of gwctl describe httproute #3071
Conversation
Welcome @tdn21! |
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 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-sigs/prow repository. |
/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! |
Hi @tdn21! Did you get a chance to make the necessary updates? |
@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. 🙇 |
a90956b
to
c85eaa1
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tdn21 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 |
c85eaa1
to
047e7de
Compare
@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 { |
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.
Can we add some unit tests for this?
} | ||
|
||
// mergePolicyMaps merges the source map into the destination map. | ||
func mergePolicyMaps(dest, src map[policyID]*PolicyNode) { |
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.
Can we use maps.Copy()
: https://pkg.go.dev/maps@go1.22.2#Copy
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.
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()) |
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.
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
Hi @tdn21! Were you able to make some progress here? |
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: Closed this PR. 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-sigs/prow repository. |
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?: