gateway-api
gateway-api copied to clipboard
gwctl: Introduce a `--for` flag to filter results related to a specified resource.
What type of PR is this? /kind feature
What this PR does / why we need it:
This PR achieves two broad things:
-
Add --for flag for filtering resources based on an associated resource.
For example:
- gwctl get backends --for gateway/ns2/my-gateway
- gwctl get gateways --for httproute/ns1/my-httproute
- gwctl get gateways --for gatewayclass/foo-gatewayclass
- gwctl get policies --for service/foo-namespace/my-svc
-
Remove duplication from cli setup of Get and Describe commands. This inturn allows both commands to share feataures/flags (when applicable) without the need to manually configure them independently for each of them
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?:
gwctl allows filtering results to only those related to the specified resource (using the `--for` flag)
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: gauravkghildiyal
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~gwctl/OWNERS~~ [gauravkghildiyal]
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
(Rebased)
Thanks @gauravkghildiyal!
/lgtm