[augerctl] Support shortname and check namespace for built-in resource#109
[augerctl] Support shortname and check namespace for built-in resource#109wzshiming wants to merge 1 commit intoetcd-io:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wzshiming The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
cca0d04 to
7e9e20c
Compare
7e9e20c to
c36f2f7
Compare
Signed-off-by: Shiming Zhang <wzshiming@hotmail.com>
c36f2f7 to
d604639
Compare
|
/cc @jmhbnz |
| "k8s.io/client-go/tools/clientcmd" | ||
| ) | ||
|
|
||
| func main() { |
There was a problem hiding this comment.
Can you document what this script does?
It is hard to decipher based on the names
There was a problem hiding this comment.
The ./pkg/wellknown/resources.go file is generated by this script, which lists all the aliases of the built-in resources.
|
|
||
| ``` bash | ||
| augerctl get services -n default kubernetes | ||
| augerctl get svc -n default kubernetes |
There was a problem hiding this comment.
Why would the short name replace the long one? Shouldn't both be supported?
There was a problem hiding this comment.
Both uses are supported, but I think the descriptions of both uses are a bit verbose.
|
Thank you @wzshiming for enriching the functionality of auger. Thanks! |
https://github.com/kubernetes/kubernetes/blob/eebc897e4fd8bf26a69d322c8dbcdf4da475934e/pkg/registry/apps/deployment/storage/storage.go#L122-L124
The short names of the built-in resources are hard-coded into the function, and there's no elegant way to get them, so the implementation here is a script that gets all the built-in resource information from the apiserver.