From f81fef1f046c1c7b423aaac8fdb7ab36a1d0b31a Mon Sep 17 00:00:00 2001 From: lojies Date: Fri, 19 Aug 2016 09:42:46 +0800 Subject: [PATCH] use valid_resources to replace kubectl.PossibleResourceTypes --- pkg/kubectl/cmd/describe.go | 3 +-- pkg/kubectl/cmd/explain.go | 2 +- pkg/kubectl/cmd/get.go | 2 +- pkg/kubectl/kubectl.go | 6 ------ 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/pkg/kubectl/cmd/describe.go b/pkg/kubectl/cmd/describe.go index 130dc51c29..7044f8a884 100644 --- a/pkg/kubectl/cmd/describe.go +++ b/pkg/kubectl/cmd/describe.go @@ -51,8 +51,7 @@ var ( will first check for an exact match on TYPE and NAME_PREFIX. If no such resource exists, it will output details for every resource that has a name prefixed with NAME_PREFIX. - `) + - kubectl.PossibleResourceTypes + `) + valid_resources describe_example = dedent.Dedent(` # Describe a node diff --git a/pkg/kubectl/cmd/explain.go b/pkg/kubectl/cmd/explain.go index 0939fc8b4c..317afc029d 100644 --- a/pkg/kubectl/cmd/explain.go +++ b/pkg/kubectl/cmd/explain.go @@ -39,7 +39,7 @@ var ( explainLong = dedent.Dedent(` Documentation of resources. - `) + kubectl.PossibleResourceTypes + `) + valid_resources ) // NewCmdExplain returns a cobra command for swagger docs diff --git a/pkg/kubectl/cmd/get.go b/pkg/kubectl/cmd/get.go index 82dac9d09f..21ecca5c8b 100644 --- a/pkg/kubectl/cmd/get.go +++ b/pkg/kubectl/cmd/get.go @@ -42,7 +42,7 @@ var ( get_long = dedent.Dedent(` Display one or many resources. - `) + kubectl.PossibleResourceTypes + dedent.Dedent(` + `) + valid_resources + dedent.Dedent(` This command will hide resources that have completed. For instance, pods that are in the Succeeded or Failed phases. You can see the full results for any resource by providing the '--show-all' flag. diff --git a/pkg/kubectl/kubectl.go b/pkg/kubectl/kubectl.go index 3a6b85ca17..70e1a47d78 100644 --- a/pkg/kubectl/kubectl.go +++ b/pkg/kubectl/kubectl.go @@ -30,12 +30,6 @@ import ( const ( kubectlAnnotationPrefix = "kubectl.kubernetes.io/" - // TODO: auto-generate this - PossibleResourceTypes = `Possible resource types include (case insensitive): pods (aka 'po'), services (aka 'svc'), deployments (aka 'deploy'), -replicasets (aka 'rs'), replicationcontrollers (aka 'rc'), nodes (aka 'no'), events (aka 'ev'), limitranges (aka 'limits'), -persistentvolumes (aka 'pv'), persistentvolumeclaims (aka 'pvc'), resourcequotas (aka 'quota'), namespaces (aka 'ns'), -serviceaccounts (aka 'sa'), ingresses (aka 'ing'), horizontalpodautoscalers (aka 'hpa'), daemonsets (aka 'ds'), configmaps (aka 'cm'), -componentstatuses (aka 'cs), endpoints (aka 'ep'), petsets (alpha feature, may be unstable) and secrets.` ) type NamespaceInfo struct {