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

[gwctl] (bug too) kubectl-compliant `get` subcommand with per-resource access

Open yashvardhan-kukreja opened this issue 9 months ago • 1 comments

What would you like to be added:

The ability to get a specific resource with gwctl like

gwctl get <RESOURCE_TYPE> <NAME>

or

gwctl get <RESOURCE_TYPE>/<NAME>

Why this is needed:

Currently, it's not possible to get a specific resource via gwctl get RESOURCE_TYPE RESOURCE_NAME because of a max limit of 1 arg set up with cobra under get.go

Due to this, the resourcediscovery.Filter's Name attribute becomes unreachable by the user despite it being used under various cases under switch kind

Moreover, the parsing of kind isn't completely compliant with kubectl convention of kubectl get RESOURCE_TYPE/RESOURCE_NAME

Where kubectl parses the kind as RESOURCE_TYPE and name as RESOURCE_NAME, gwctl blindly parses the kind as RESOURCE_TYPE/RESOURCE_NAME and name as ""

yashvardhan-kukreja avatar May 01 '24 11:05 yashvardhan-kukreja

/assign

yashvardhan-kukreja avatar May 01 '24 11:05 yashvardhan-kukreja

Closing as per comments in the PR. Though really appreciate the analysis

/close

gauravkghildiyal avatar Jun 06 '24 06:06 gauravkghildiyal

@gauravkghildiyal: Closing this issue.

In response to this:

Closing as per comments in the PR. Though really appreciate the analysis

/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.

k8s-ci-robot avatar Jun 06 '24 06:06 k8s-ci-robot