Merge pull request #21509 from madhusudancs/kubectl-get-list-deployments-daemonsets

Add DaemonSets and Deployments to valid resources list in kubectl.
pull/6/head
Brian Grant 2016-02-24 15:30:08 -08:00
commit 80614896db
2 changed files with 7 additions and 0 deletions

View File

@ -110,8 +110,13 @@ __custom_func() {
esac
}
`
// If you add a resource to this list, please also take a look at pkg/kubectl/kubectl.go
// and add a short forms entry in expandResourceShortcut() when appropriate.
valid_resources = `Valid resource types include:
* componentstatuses (aka 'cs')
* daemonsets (aka 'ds')
* deployments
* events (aka 'ev')
* endpoints (aka 'ep')
* horizontalpodautoscalers (aka 'hpa')

View File

@ -100,6 +100,8 @@ func (e ShortcutExpander) ResourceSingularizer(resource string) (string, error)
func expandResourceShortcut(resource unversioned.GroupVersionResource) unversioned.GroupVersionResource {
shortForms := map[string]unversioned.GroupVersionResource{
// Please keep this alphabetized
// If you add an entry here, please also take a look at pkg/kubectl/cmd/cmd.go
// and add an entry to valid_resources when appropriate.
"cs": api.SchemeGroupVersion.WithResource("componentstatuses"),
"ds": extensions.SchemeGroupVersion.WithResource("daemonsets"),
"ep": api.SchemeGroupVersion.WithResource("endpoints"),