gateway-api icon indicating copy to clipboard operation
gateway-api copied to clipboard

gwctl: Introduce a `--for` flag to filter results related to a specified resource.

Open gauravkghildiyal opened this issue 9 months ago • 1 comments

What type of PR is this? /kind feature

What this PR does / why we need it:

This PR achieves two broad things:

  1. 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
  2. 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)

gauravkghildiyal avatar May 09 '24 18:05 gauravkghildiyal

[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

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 avatar May 09 '24 18:05 k8s-ci-robot

(Rebased)

gauravkghildiyal avatar May 16 '24 21:05 gauravkghildiyal

Thanks @gauravkghildiyal!

/lgtm

robscott avatar May 16 '24 23:05 robscott