-
Notifications
You must be signed in to change notification settings - Fork 15
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
[augerctl] Support shortname and check namespace for built-in resource #109
base: main
Are you sure you want to change the base?
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.
Needs 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 <[email protected]>
c36f2f7
to
d604639
Compare
/cc @jmhbnz |
"k8s.io/client-go/tools/clientcmd" | ||
) | ||
|
||
func main() { |
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 you document what this script does?
It is hard to decipher based on the names
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.
The ./pkg/wellknown/resources.go
file is generated by this script, which lists all the aliases of the built-in resources.
@@ -62,10 +62,10 @@ TODO | |||
List a single service with namespace `default` and name `kubernetes` | |||
|
|||
``` bash | |||
augerctl get services -n default kubernetes | |||
augerctl get svc -n default kubernetes |
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.
Why would the short name replace the long one? Shouldn't both be supported?
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.
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.