Merge pull request #18835 from brendandburns/3rdparty

Automatic merge from submit-queue

Add support for 3rd party objects to kubectl

@deads2k @jlowdermilk

Instructions for playing around with this:

Run an apiserver with third party resources turned on (`--runtime-config=extensions/v1beta1=true,extensions/v1beta1/thirdpartyresources=true`)

Then you should be able to:

```
kubectl create -f rsrc.json
```

```json
{
  "metadata": {
    "name": "foo.company.com"
  },
  "apiVersion": "extensions/v1beta1",
  "kind": "ThirdPartyResource",
  "versions": [
    {
      "apiGroup": "group",
      "name": "v1"
    },
    {
      "apiGroup": "group",
      "name": "v2"
    }
  ]
}
```

Once that is done, you should be able to:

```
curl http://<server>/apis/company.com/v1/foos
```

```
curl -X POST -d @${HOME}/foo.json http://localhost:8080/apis/company.com/v1/namespaces/default/foos
```

```json
{
  "kind": "Foo",
  "apiVersion": "company.com/v1",
  "metadata": {
    "name": "baz"
  },
  "someField": "hello world",
  "otherField": 1
}
```

After this PR, you can do:

```
kubectl create -f foo.json
```

```
kubectl get foos
```

etc.
This commit is contained in:
k8s-merge-robot 2016-03-31 18:09:56 -07:00
commit 07929972a3
115 changed files with 697 additions and 148 deletions

View File

@ -272,6 +272,7 @@ _kubectl_get()
two_word_flags+=("-f") two_word_flags+=("-f")
flags_with_completion+=("-f") flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--include-extended-apis")
flags+=("--label-columns=") flags+=("--label-columns=")
two_word_flags+=("-L") two_word_flags+=("-L")
flags+=("--no-headers") flags+=("--no-headers")
@ -342,6 +343,7 @@ _kubectl_get()
must_have_one_noun+=("service") must_have_one_noun+=("service")
must_have_one_noun+=("serviceaccount") must_have_one_noun+=("serviceaccount")
must_have_one_noun+=("thirdpartyresource") must_have_one_noun+=("thirdpartyresource")
must_have_one_noun+=("thirdpartyresourcedata")
} }
_kubectl_describe() _kubectl_describe()
@ -360,6 +362,7 @@ _kubectl_describe()
two_word_flags+=("-f") two_word_flags+=("-f")
flags_with_completion+=("-f") flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--include-extended-apis")
flags+=("--recursive") flags+=("--recursive")
flags+=("-R") flags+=("-R")
flags+=("--selector=") flags+=("--selector=")
@ -484,6 +487,7 @@ _kubectl_create_secret_docker-registry()
flags+=("--docker-username=") flags+=("--docker-username=")
flags+=("--dry-run") flags+=("--dry-run")
flags+=("--generator=") flags+=("--generator=")
flags+=("--include-extended-apis")
flags+=("--no-headers") flags+=("--no-headers")
flags+=("--output=") flags+=("--output=")
two_word_flags+=("-o") two_word_flags+=("-o")
@ -695,6 +699,7 @@ _kubectl_create_serviceaccount()
flags+=("--dry-run") flags+=("--dry-run")
flags+=("--generator=") flags+=("--generator=")
flags+=("--include-extended-apis")
flags+=("--no-headers") flags+=("--no-headers")
flags+=("--output=") flags+=("--output=")
two_word_flags+=("-o") two_word_flags+=("-o")
@ -757,6 +762,7 @@ _kubectl_create()
two_word_flags+=("-f") two_word_flags+=("-f")
flags_with_completion+=("-f") flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--include-extended-apis")
flags+=("--output=") flags+=("--output=")
two_word_flags+=("-o") two_word_flags+=("-o")
flags+=("--record") flags+=("--record")
@ -815,6 +821,7 @@ _kubectl_replace()
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--force") flags+=("--force")
flags+=("--grace-period=") flags+=("--grace-period=")
flags+=("--include-extended-apis")
flags+=("--output=") flags+=("--output=")
two_word_flags+=("-o") two_word_flags+=("-o")
flags+=("--record") flags+=("--record")
@ -871,6 +878,7 @@ _kubectl_patch()
two_word_flags+=("-f") two_word_flags+=("-f")
flags_with_completion+=("-f") flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--include-extended-apis")
flags+=("--output=") flags+=("--output=")
two_word_flags+=("-o") two_word_flags+=("-o")
flags+=("--patch=") flags+=("--patch=")
@ -930,6 +938,7 @@ _kubectl_delete()
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--grace-period=") flags+=("--grace-period=")
flags+=("--ignore-not-found") flags+=("--ignore-not-found")
flags+=("--include-extended-apis")
flags+=("--output=") flags+=("--output=")
two_word_flags+=("-o") two_word_flags+=("-o")
flags+=("--recursive") flags+=("--recursive")
@ -988,6 +997,7 @@ _kubectl_delete()
must_have_one_noun+=("service") must_have_one_noun+=("service")
must_have_one_noun+=("serviceaccount") must_have_one_noun+=("serviceaccount")
must_have_one_noun+=("thirdpartyresource") must_have_one_noun+=("thirdpartyresource")
must_have_one_noun+=("thirdpartyresourcedata")
} }
_kubectl_edit() _kubectl_edit()
@ -1006,6 +1016,7 @@ _kubectl_edit()
two_word_flags+=("-f") two_word_flags+=("-f")
flags_with_completion+=("-f") flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--include-extended-apis")
flags+=("--output=") flags+=("--output=")
two_word_flags+=("-o") two_word_flags+=("-o")
flags+=("--output-version=") flags+=("--output-version=")
@ -1059,6 +1070,7 @@ _kubectl_apply()
two_word_flags+=("-f") two_word_flags+=("-f")
flags_with_completion+=("-f") flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--include-extended-apis")
flags+=("--output=") flags+=("--output=")
two_word_flags+=("-o") two_word_flags+=("-o")
flags+=("--record") flags+=("--record")
@ -1150,6 +1162,7 @@ _kubectl_logs()
two_word_flags+=("-c") two_word_flags+=("-c")
flags+=("--follow") flags+=("--follow")
flags+=("-f") flags+=("-f")
flags+=("--include-extended-apis")
flags+=("--interactive") flags+=("--interactive")
flags+=("--limit-bytes=") flags+=("--limit-bytes=")
flags+=("--previous") flags+=("--previous")
@ -1207,6 +1220,7 @@ _kubectl_rolling-update()
flags_with_completion+=("-f") flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--image=") flags+=("--image=")
flags+=("--include-extended-apis")
flags+=("--no-headers") flags+=("--no-headers")
flags+=("--output=") flags+=("--output=")
two_word_flags+=("-o") two_word_flags+=("-o")
@ -1272,6 +1286,7 @@ _kubectl_scale()
two_word_flags+=("-f") two_word_flags+=("-f")
flags_with_completion+=("-f") flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--include-extended-apis")
flags+=("--output=") flags+=("--output=")
two_word_flags+=("-o") two_word_flags+=("-o")
flags+=("--record") flags+=("--record")
@ -1635,6 +1650,7 @@ _kubectl_run()
flags+=("--generator=") flags+=("--generator=")
flags+=("--hostport=") flags+=("--hostport=")
flags+=("--image=") flags+=("--image=")
flags+=("--include-extended-apis")
flags+=("--labels=") flags+=("--labels=")
two_word_flags+=("-l") two_word_flags+=("-l")
flags+=("--leave-stdin-open") flags+=("--leave-stdin-open")
@ -1787,6 +1803,7 @@ _kubectl_autoscale()
flags_with_completion+=("-f") flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--generator=") flags+=("--generator=")
flags+=("--include-extended-apis")
flags+=("--max=") flags+=("--max=")
flags+=("--min=") flags+=("--min=")
flags+=("--name=") flags+=("--name=")
@ -2085,6 +2102,7 @@ _kubectl_label()
two_word_flags+=("-f") two_word_flags+=("-f")
flags_with_completion+=("-f") flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--include-extended-apis")
flags+=("--no-headers") flags+=("--no-headers")
flags+=("--output=") flags+=("--output=")
two_word_flags+=("-o") two_word_flags+=("-o")
@ -2153,6 +2171,7 @@ _kubectl_label()
must_have_one_noun+=("service") must_have_one_noun+=("service")
must_have_one_noun+=("serviceaccount") must_have_one_noun+=("serviceaccount")
must_have_one_noun+=("thirdpartyresource") must_have_one_noun+=("thirdpartyresource")
must_have_one_noun+=("thirdpartyresourcedata")
} }
_kubectl_annotate() _kubectl_annotate()
@ -2172,6 +2191,7 @@ _kubectl_annotate()
two_word_flags+=("-f") two_word_flags+=("-f")
flags_with_completion+=("-f") flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--include-extended-apis")
flags+=("--no-headers") flags+=("--no-headers")
flags+=("--output=") flags+=("--output=")
two_word_flags+=("-o") two_word_flags+=("-o")
@ -2602,6 +2622,7 @@ _kubectl_cluster-info()
flags_with_completion=() flags_with_completion=()
flags_completion=() flags_completion=()
flags+=("--include-extended-apis")
flags+=("--alsologtostderr") flags+=("--alsologtostderr")
flags+=("--api-version=") flags+=("--api-version=")
flags+=("--certificate-authority=") flags+=("--certificate-authority=")
@ -2721,6 +2742,7 @@ _kubectl_explain()
flags_with_completion=() flags_with_completion=()
flags_completion=() flags_completion=()
flags+=("--include-extended-apis")
flags+=("--recursive") flags+=("--recursive")
flags+=("--alsologtostderr") flags+=("--alsologtostderr")
flags+=("--api-version=") flags+=("--api-version=")
@ -2767,6 +2789,7 @@ _kubectl_convert()
two_word_flags+=("-f") two_word_flags+=("-f")
flags_with_completion+=("-f") flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml") flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--include-extended-apis")
flags+=("--local") flags+=("--local")
flags+=("--no-headers") flags+=("--no-headers")
flags+=("--output=") flags+=("--output=")

View File

@ -37,6 +37,10 @@ horizontalpodautoscalers (hpa), resourcequotas (quota) or secrets.
\fB\-f\fP, \fB\-\-filename\fP=[] \fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to a file identifying the resource to update the annotation Filename, directory, or URL to a file identifying the resource to update the annotation
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-\-no\-headers\fP=false \fB\-\-no\-headers\fP=false
When using the default output, don't print headers. When using the default output, don't print headers.

View File

@ -25,6 +25,10 @@ JSON and YAML formats are accepted.
\fB\-f\fP, \fB\-\-filename\fP=[] \fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to file that contains the configuration to apply Filename, directory, or URL to file that contains the configuration to apply
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-o\fP, \fB\-\-output\fP="" \fB\-o\fP, \fB\-\-output\fP=""
Output mode. Use "\-o name" for shorter output (resource/name). Output mode. Use "\-o name" for shorter output (resource/name).

View File

@ -37,6 +37,10 @@ An autoscaler can automatically increase or decrease number of pods deployed wit
\fB\-\-generator\fP="horizontalpodautoscaler/v1beta1" \fB\-\-generator\fP="horizontalpodautoscaler/v1beta1"
The name of the API generator to use. Currently there is only 1 generator. The name of the API generator to use. Currently there is only 1 generator.
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-\-max\fP=\-1 \fB\-\-max\fP=\-1
The upper limit for the number of pods that can be set by the autoscaler. Required. The upper limit for the number of pods that can be set by the autoscaler. Required.

View File

@ -16,6 +16,12 @@ kubectl cluster\-info \- Display cluster info
Display addresses of the master and services with label kubernetes.io/cluster\-service=true Display addresses of the master and services with label kubernetes.io/cluster\-service=true
.SH OPTIONS
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.SH OPTIONS INHERITED FROM PARENT COMMANDS .SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP .PP
\fB\-\-alsologtostderr\fP=false \fB\-\-alsologtostderr\fP=false

View File

@ -31,6 +31,10 @@ to change to output destination.
\fB\-f\fP, \fB\-\-filename\fP=[] \fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to file to need to get converted. Filename, directory, or URL to file to need to get converted.
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-\-local\fP=true \fB\-\-local\fP=true
If true, convert will NOT try to contact api\-server but run locally. If true, convert will NOT try to contact api\-server but run locally.

View File

@ -56,6 +56,10 @@ by creating a dockercfg secret and attaching it to your service account.
\fB\-\-generator\fP="secret\-for\-docker\-registry/v1" \fB\-\-generator\fP="secret\-for\-docker\-registry/v1"
The name of the API generator to use. The name of the API generator to use.
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-\-no\-headers\fP=false \fB\-\-no\-headers\fP=false
When using the default output, don't print headers. When using the default output, don't print headers.

View File

@ -25,6 +25,10 @@ Create a service account with the specified name.
\fB\-\-generator\fP="serviceaccount/v1" \fB\-\-generator\fP="serviceaccount/v1"
The name of the API generator to use. The name of the API generator to use.
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-\-no\-headers\fP=false \fB\-\-no\-headers\fP=false
When using the default output, don't print headers. When using the default output, don't print headers.

View File

@ -24,6 +24,10 @@ JSON and YAML formats are accepted.
\fB\-f\fP, \fB\-\-filename\fP=[] \fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to file to use to create the resource Filename, directory, or URL to file to use to create the resource
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-o\fP, \fB\-\-output\fP="" \fB\-o\fP, \fB\-\-output\fP=""
Output mode. Use "\-o name" for shorter output (resource/name). Output mode. Use "\-o name" for shorter output (resource/name).

View File

@ -48,6 +48,10 @@ will be lost along with the rest of the resource.
\fB\-\-ignore\-not\-found\fP=false \fB\-\-ignore\-not\-found\fP=false
Treat "resource not found" as a successful delete. Defaults to "true" when \-\-all is specified. Treat "resource not found" as a successful delete. Defaults to "true" when \-\-all is specified.
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-o\fP, \fB\-\-output\fP="" \fB\-o\fP, \fB\-\-output\fP=""
Output mode. Use "\-o name" for shorter output (resource/name). Output mode. Use "\-o name" for shorter output (resource/name).

View File

@ -39,6 +39,10 @@ componentstatuses (cs), endpoints (ep), and secrets.
\fB\-f\fP, \fB\-\-filename\fP=[] \fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to a file containing the resource to describe Filename, directory, or URL to a file containing the resource to describe
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-R\fP, \fB\-\-recursive\fP=false \fB\-R\fP, \fB\-\-recursive\fP=false
If true, process directory recursively. If true, process directory recursively.

View File

@ -42,6 +42,10 @@ saved copy to include the latest resource version.
\fB\-f\fP, \fB\-\-filename\fP=[] \fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to file to use to edit the resource Filename, directory, or URL to file to use to edit the resource
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-o\fP, \fB\-\-output\fP="yaml" \fB\-o\fP, \fB\-\-output\fP="yaml"
Output format. One of: yaml|json. Output format. One of: yaml|json.

View File

@ -24,6 +24,10 @@ componentstatuses (cs), endpoints (ep), and secrets.
.SH OPTIONS .SH OPTIONS
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-\-recursive\fP=false \fB\-\-recursive\fP=false
Print the fields of fields (Currently only 1 level deep) Print the fields of fields (Currently only 1 level deep)

View File

@ -40,6 +40,10 @@ of the \-\-template flag, you can filter the attributes of the fetched resource(
\fB\-f\fP, \fB\-\-filename\fP=[] \fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to a file identifying the resource to get from a server. Filename, directory, or URL to a file identifying the resource to get from a server.
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-L\fP, \fB\-\-label\-columns\fP=[] \fB\-L\fP, \fB\-\-label\-columns\fP=[]
Accepts a comma separated list of labels that are going to be presented as columns. Names are case\-sensitive. You can also use multiple flag statements like \-L label1 \-L label2... Accepts a comma separated list of labels that are going to be presented as columns. Names are case\-sensitive. You can also use multiple flag statements like \-L label1 \-L label2...

View File

@ -34,6 +34,10 @@ If \-\-resource\-version is specified, then updates will use this resource versi
\fB\-f\fP, \fB\-\-filename\fP=[] \fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to a file identifying the resource to update the labels Filename, directory, or URL to a file identifying the resource to update the labels
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-\-no\-headers\fP=false \fB\-\-no\-headers\fP=false
When using the default output, don't print headers. When using the default output, don't print headers.

View File

@ -25,6 +25,10 @@ Print the logs for a container in a pod. If the pod has only one container, the
\fB\-f\fP, \fB\-\-follow\fP=false \fB\-f\fP, \fB\-\-follow\fP=false
Specify if the logs should be streamed. Specify if the logs should be streamed.
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-\-interactive\fP=false \fB\-\-interactive\fP=false
If true, prompt the user for input when required. If true, prompt the user for input when required.

View File

@ -28,6 +28,10 @@ Please refer to the models in
\fB\-f\fP, \fB\-\-filename\fP=[] \fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to a file identifying the resource to update Filename, directory, or URL to a file identifying the resource to update
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-o\fP, \fB\-\-output\fP="" \fB\-o\fP, \fB\-\-output\fP=""
Output mode. Use "\-o name" for shorter output (resource/name). Output mode. Use "\-o name" for shorter output (resource/name).

View File

@ -42,6 +42,10 @@ Please refer to the models in
\fB\-\-grace\-period\fP=\-1 \fB\-\-grace\-period\fP=\-1
Only relevant during a force replace. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative. Only relevant during a force replace. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative.
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-o\fP, \fB\-\-output\fP="" \fB\-o\fP, \fB\-\-output\fP=""
Output mode. Use "\-o name" for shorter output (resource/name). Output mode. Use "\-o name" for shorter output (resource/name).

View File

@ -42,6 +42,10 @@ existing replication controller and overwrite at least one (common) label in its
\fB\-\-image\fP="" \fB\-\-image\fP=""
Image to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with \-\-filename/\-f Image to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with \-\-filename/\-f
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-\-no\-headers\fP=false \fB\-\-no\-headers\fP=false
When using the default output, don't print headers. When using the default output, don't print headers.

View File

@ -50,6 +50,10 @@ Creates a deployment or job to manage the created container(s).
\fB\-\-image\fP="" \fB\-\-image\fP=""
The image for the container to run. The image for the container to run.
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-l\fP, \fB\-\-labels\fP="" \fB\-l\fP, \fB\-\-labels\fP=""
Labels to apply to the pod(s). Labels to apply to the pod(s).

View File

@ -31,6 +31,10 @@ scale is sent to the server.
\fB\-f\fP, \fB\-\-filename\fP=[] \fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to a file identifying the resource to set a new size Filename, directory, or URL to a file identifying the resource to set a new size
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-o\fP, \fB\-\-output\fP="" \fB\-o\fP, \fB\-\-output\fP=""
Output mode. Use "\-o name" for shorter output (resource/name). Output mode. Use "\-o name" for shorter output (resource/name).

View File

@ -41,6 +41,10 @@ If the resource is scalable it will be scaled to 0 before deletion.
\fB\-\-ignore\-not\-found\fP=false \fB\-\-ignore\-not\-found\fP=false
Treat "resource not found" as a successful stop. Treat "resource not found" as a successful stop.
.PP
\fB\-\-include\-extended\-apis\fP=true
If true, include definitions of new APIs via calls to the API server. [default true]
.PP .PP
\fB\-o\fP, \fB\-\-output\fP="" \fB\-o\fP, \fB\-\-output\fP=""
Output mode. Use "\-o name" for shorter output (resource/name). Output mode. Use "\-o name" for shorter output (resource/name).

View File

@ -108,7 +108,7 @@ kubectl
* [kubectl uncordon](kubectl_uncordon.md) - Mark node as schedulable * [kubectl uncordon](kubectl_uncordon.md) - Mark node as schedulable
* [kubectl version](kubectl_version.md) - Print the client and server version information. * [kubectl version](kubectl_version.md) - Print the client and server version information.
###### Auto generated by spf13/cobra on 22-Mar-2016 ###### Auto generated by spf13/cobra on 25-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl.md?pixel)]()

View File

@ -84,6 +84,7 @@ kubectl annotate pods foo description-
``` ```
--all[=false]: select all resources in the namespace of the specified resource types --all[=false]: select all resources in the namespace of the specified resource types
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to update the annotation -f, --filename=[]: Filename, directory, or URL to a file identifying the resource to update the annotation
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
--no-headers[=false]: When using the default output, don't print headers. --no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md]. -o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md].
--output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1'). --output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
@ -129,7 +130,7 @@ kubectl annotate pods foo description-
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_annotate.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_annotate.md?pixel)]()

View File

@ -76,7 +76,7 @@ kubectl api-versions
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_api-versions.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_api-versions.md?pixel)]()

View File

@ -62,6 +62,7 @@ cat pod.json | kubectl apply -f -
``` ```
-f, --filename=[]: Filename, directory, or URL to file that contains the configuration to apply -f, --filename=[]: Filename, directory, or URL to file that contains the configuration to apply
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
-o, --output="": Output mode. Use "-o name" for shorter output (resource/name). -o, --output="": Output mode. Use "-o name" for shorter output (resource/name).
--record[=false]: Record current kubectl command in the resource annotation. --record[=false]: Record current kubectl command in the resource annotation.
-R, --recursive[=false]: If true, process directory recursively. -R, --recursive[=false]: If true, process directory recursively.
@ -100,7 +101,7 @@ cat pod.json | kubectl apply -f -
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_apply.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_apply.md?pixel)]()

View File

@ -98,7 +98,7 @@ kubectl attach 123456-7890 -c ruby-container -i -t
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_attach.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_attach.md?pixel)]()

View File

@ -65,6 +65,7 @@ kubectl autoscale rc foo --max=5 --cpu-percent=80
--dry-run[=false]: If true, only print the object that would be sent, without creating it. --dry-run[=false]: If true, only print the object that would be sent, without creating it.
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to autoscale. -f, --filename=[]: Filename, directory, or URL to a file identifying the resource to autoscale.
--generator="horizontalpodautoscaler/v1beta1": The name of the API generator to use. Currently there is only 1 generator. --generator="horizontalpodautoscaler/v1beta1": The name of the API generator to use. Currently there is only 1 generator.
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
--max=-1: The upper limit for the number of pods that can be set by the autoscaler. Required. --max=-1: The upper limit for the number of pods that can be set by the autoscaler. Required.
--min=-1: The lower limit for the number of pods that can be set by the autoscaler. If it's not specified or negative, the server will apply a default value. --min=-1: The lower limit for the number of pods that can be set by the autoscaler. If it's not specified or negative, the server will apply a default value.
--name="": The name for the newly created object. If not specified, the name of the input resource will be used. --name="": The name for the newly created object. If not specified, the name of the input resource will be used.
@ -111,7 +112,7 @@ kubectl autoscale rc foo --max=5 --cpu-percent=80
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_autoscale.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_autoscale.md?pixel)]()

View File

@ -45,6 +45,12 @@ Display addresses of the master and services with label kubernetes.io/cluster-se
kubectl cluster-info kubectl cluster-info
``` ```
### Options
```
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
@ -76,7 +82,7 @@ kubectl cluster-info
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_cluster-info.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_cluster-info.md?pixel)]()

View File

@ -95,7 +95,7 @@ kubectl config SUBCOMMAND
* [kubectl config use-context](kubectl_config_use-context.md) - Sets the current-context in a kubeconfig file * [kubectl config use-context](kubectl_config_use-context.md) - Sets the current-context in a kubeconfig file
* [kubectl config view](kubectl_config_view.md) - Displays merged kubeconfig settings or a specified kubeconfig file. * [kubectl config view](kubectl_config_view.md) - Displays merged kubeconfig settings or a specified kubeconfig file.
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config.md?pixel)]()

View File

@ -83,7 +83,7 @@ kubectl config current-context
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_current-context.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_current-context.md?pixel)]()

View File

@ -97,7 +97,7 @@ kubectl config set-cluster e2e --insecure-skip-tls-verify=true
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-cluster.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-cluster.md?pixel)]()

View File

@ -89,7 +89,7 @@ kubectl config set-context gce --user=cluster-admin
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-context.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-context.md?pixel)]()

View File

@ -109,7 +109,7 @@ kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admin.
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-credentials.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-credentials.md?pixel)]()

View File

@ -78,7 +78,7 @@ kubectl config set PROPERTY_NAME PROPERTY_VALUE
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set.md?pixel)]()

View File

@ -77,7 +77,7 @@ kubectl config unset PROPERTY_NAME
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_unset.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_unset.md?pixel)]()

View File

@ -76,7 +76,7 @@ kubectl config use-context CONTEXT_NAME
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_use-context.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_use-context.md?pixel)]()

View File

@ -104,7 +104,7 @@ kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_view.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_view.md?pixel)]()

View File

@ -73,6 +73,7 @@ kubectl convert -f . | kubectl create -f -
``` ```
-f, --filename=[]: Filename, directory, or URL to file to need to get converted. -f, --filename=[]: Filename, directory, or URL to file to need to get converted.
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
--local[=true]: If true, convert will NOT try to contact api-server but run locally. --local[=true]: If true, convert will NOT try to contact api-server but run locally.
--no-headers[=false]: When using the default output, don't print headers. --no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md]. -o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md].
@ -117,7 +118,7 @@ kubectl convert -f . | kubectl create -f -
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_convert.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_convert.md?pixel)]()

View File

@ -85,7 +85,7 @@ kubectl cordon foo
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_cordon.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_cordon.md?pixel)]()

View File

@ -61,6 +61,7 @@ cat pod.json | kubectl create -f -
``` ```
-f, --filename=[]: Filename, directory, or URL to file to use to create the resource -f, --filename=[]: Filename, directory, or URL to file to use to create the resource
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
-o, --output="": Output mode. Use "-o name" for shorter output (resource/name). -o, --output="": Output mode. Use "-o name" for shorter output (resource/name).
--record[=false]: Record current kubectl command in the resource annotation. --record[=false]: Record current kubectl command in the resource annotation.
-R, --recursive[=false]: If true, process directory recursively. -R, --recursive[=false]: If true, process directory recursively.
@ -104,7 +105,7 @@ cat pod.json | kubectl create -f -
* [kubectl create secret](kubectl_create_secret.md) - Create a secret using specified subcommand. * [kubectl create secret](kubectl_create_secret.md) - Create a secret using specified subcommand.
* [kubectl create serviceaccount](kubectl_create_serviceaccount.md) - Create a service account with the specified name. * [kubectl create serviceaccount](kubectl_create_serviceaccount.md) - Create a service account with the specified name.
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create.md?pixel)]()

View File

@ -118,7 +118,7 @@ kubectl create configmap NAME [--type=string] [--from-file=[key=]source] [--from
* [kubectl create](kubectl_create.md) - Create a resource by filename or stdin * [kubectl create](kubectl_create.md) - Create a resource by filename or stdin
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 31-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_configmap.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_configmap.md?pixel)]()

View File

@ -101,7 +101,7 @@ kubectl create namespace NAME [--dry-run]
* [kubectl create](kubectl_create.md) - Create a resource by filename or stdin * [kubectl create](kubectl_create.md) - Create a resource by filename or stdin
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_namespace.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_namespace.md?pixel)]()

View File

@ -78,7 +78,7 @@ kubectl create secret
* [kubectl create secret docker-registry](kubectl_create_secret_docker-registry.md) - Create a secret for use with a Docker registry. * [kubectl create secret docker-registry](kubectl_create_secret_docker-registry.md) - Create a secret for use with a Docker registry.
* [kubectl create secret generic](kubectl_create_secret_generic.md) - Create a secret from a local file, directory or literal value. * [kubectl create secret generic](kubectl_create_secret_generic.md) - Create a secret from a local file, directory or literal value.
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_secret.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_secret.md?pixel)]()

View File

@ -73,6 +73,7 @@ kubectl create secret docker-registry NAME --docker-username=user --docker-passw
--docker-username="": Username for Docker registry authentication --docker-username="": Username for Docker registry authentication
--dry-run[=false]: If true, only print the object that would be sent, without sending it. --dry-run[=false]: If true, only print the object that would be sent, without sending it.
--generator="secret-for-docker-registry/v1": The name of the API generator to use. --generator="secret-for-docker-registry/v1": The name of the API generator to use.
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
--no-headers[=false]: When using the default output, don't print headers. --no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md]. -o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md].
--output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1'). --output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
@ -116,7 +117,7 @@ kubectl create secret docker-registry NAME --docker-username=user --docker-passw
* [kubectl create secret](kubectl_create_secret.md) - Create a secret using specified subcommand. * [kubectl create secret](kubectl_create_secret.md) - Create a secret using specified subcommand.
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_secret_docker-registry.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_secret_docker-registry.md?pixel)]()

View File

@ -120,7 +120,7 @@ kubectl create secret generic NAME [--type=string] [--from-file=[key=]source] [-
* [kubectl create secret](kubectl_create_secret.md) - Create a secret using specified subcommand. * [kubectl create secret](kubectl_create_secret.md) - Create a secret using specified subcommand.
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 31-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_secret_generic.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_secret_generic.md?pixel)]()

View File

@ -58,6 +58,7 @@ kubectl create serviceaccount NAME [--dry-run]
``` ```
--dry-run[=false]: If true, only print the object that would be sent, without sending it. --dry-run[=false]: If true, only print the object that would be sent, without sending it.
--generator="serviceaccount/v1": The name of the API generator to use. --generator="serviceaccount/v1": The name of the API generator to use.
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
--no-headers[=false]: When using the default output, don't print headers. --no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md]. -o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md].
--output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1'). --output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
@ -101,7 +102,7 @@ kubectl create serviceaccount NAME [--dry-run]
* [kubectl create](kubectl_create.md) - Create a resource by filename or stdin * [kubectl create](kubectl_create.md) - Create a resource by filename or stdin
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_serviceaccount.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create_serviceaccount.md?pixel)]()

View File

@ -83,6 +83,7 @@ kubectl delete pods --all
-f, --filename=[]: Filename, directory, or URL to a file containing the resource to delete. -f, --filename=[]: Filename, directory, or URL to a file containing the resource to delete.
--grace-period=-1: Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. --grace-period=-1: Period of time in seconds given to the resource to terminate gracefully. Ignored if negative.
--ignore-not-found[=false]: Treat "resource not found" as a successful delete. Defaults to "true" when --all is specified. --ignore-not-found[=false]: Treat "resource not found" as a successful delete. Defaults to "true" when --all is specified.
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
-o, --output="": Output mode. Use "-o name" for shorter output (resource/name). -o, --output="": Output mode. Use "-o name" for shorter output (resource/name).
-R, --recursive[=false]: If true, process directory recursively. -R, --recursive[=false]: If true, process directory recursively.
-l, --selector="": Selector (label query) to filter on. -l, --selector="": Selector (label query) to filter on.
@ -120,7 +121,7 @@ kubectl delete pods --all
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_delete.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_delete.md?pixel)]()

View File

@ -86,6 +86,7 @@ kubectl describe pods frontend
``` ```
-f, --filename=[]: Filename, directory, or URL to a file containing the resource to describe -f, --filename=[]: Filename, directory, or URL to a file containing the resource to describe
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
-R, --recursive[=false]: If true, process directory recursively. -R, --recursive[=false]: If true, process directory recursively.
-l, --selector="": Selector (label query) to filter on -l, --selector="": Selector (label query) to filter on
``` ```
@ -121,7 +122,7 @@ kubectl describe pods frontend
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_describe.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_describe.md?pixel)]()

View File

@ -108,7 +108,7 @@ $ kubectl drain foo --grace-period=900
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 31-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_drain.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_drain.md?pixel)]()

View File

@ -80,6 +80,7 @@ kubectl edit (RESOURCE/NAME | -f FILENAME)
``` ```
-f, --filename=[]: Filename, directory, or URL to file to use to edit the resource -f, --filename=[]: Filename, directory, or URL to file to use to edit the resource
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
-o, --output="yaml": Output format. One of: yaml|json. -o, --output="yaml": Output format. One of: yaml|json.
--output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1'). --output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
--record[=false]: Record current kubectl command in the resource annotation. --record[=false]: Record current kubectl command in the resource annotation.
@ -119,7 +120,7 @@ kubectl edit (RESOURCE/NAME | -f FILENAME)
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_edit.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_edit.md?pixel)]()

View File

@ -99,7 +99,7 @@ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_exec.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_exec.md?pixel)]()

View File

@ -64,6 +64,7 @@ kubectl explain pods.spec.containers
### Options ### Options
``` ```
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
--recursive[=false]: Print the fields of fields (Currently only 1 level deep) --recursive[=false]: Print the fields of fields (Currently only 1 level deep)
``` ```
@ -98,7 +99,7 @@ kubectl explain pods.spec.containers
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 25-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_explain.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_explain.md?pixel)]()

View File

@ -138,7 +138,7 @@ kubectl expose deployment nginx --port=80 --target-port=8000
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_expose.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_expose.md?pixel)]()

View File

@ -88,6 +88,7 @@ kubectl get rc/web service/frontend pods/web-pod-13je7
--all-namespaces[=false]: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace. --all-namespaces[=false]: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
--export[=false]: If true, use 'export' for the resources. Exported resources are stripped of cluster-specific information. --export[=false]: If true, use 'export' for the resources. Exported resources are stripped of cluster-specific information.
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to get from a server. -f, --filename=[]: Filename, directory, or URL to a file identifying the resource to get from a server.
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
-L, --label-columns=[]: Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag statements like -L label1 -L label2... -L, --label-columns=[]: Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag statements like -L label1 -L label2...
--no-headers[=false]: When using the default output, don't print headers. --no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md]. -o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md].
@ -133,7 +134,7 @@ kubectl get rc/web service/frontend pods/web-pod-13je7
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_get.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_get.md?pixel)]()

View File

@ -78,6 +78,7 @@ kubectl label pods foo bar-
--all[=false]: select all resources in the namespace of the specified resource types --all[=false]: select all resources in the namespace of the specified resource types
--dry-run[=false]: If true, only print the object that would be sent, without sending it. --dry-run[=false]: If true, only print the object that would be sent, without sending it.
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to update the labels -f, --filename=[]: Filename, directory, or URL to a file identifying the resource to update the labels
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
--no-headers[=false]: When using the default output, don't print headers. --no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md]. -o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md].
--output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1'). --output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
@ -123,7 +124,7 @@ kubectl label pods foo bar-
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_label.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_label.md?pixel)]()

View File

@ -69,6 +69,7 @@ kubectl logs --since=1h nginx
``` ```
-c, --container="": Print the logs of this container -c, --container="": Print the logs of this container
-f, --follow[=false]: Specify if the logs should be streamed. -f, --follow[=false]: Specify if the logs should be streamed.
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
--limit-bytes=0: Maximum bytes of logs to return. Defaults to no limit. --limit-bytes=0: Maximum bytes of logs to return. Defaults to no limit.
-p, --previous[=false]: If true, print the logs for the previous instance of the container in a pod if it exists. -p, --previous[=false]: If true, print the logs for the previous instance of the container in a pod if it exists.
--since=0: Only return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs. Only one of since-time / since may be used. --since=0: Only return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs. Only one of since-time / since may be used.
@ -108,7 +109,7 @@ kubectl logs --since=1h nginx
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_logs.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_logs.md?pixel)]()

View File

@ -79,7 +79,7 @@ kubectl namespace [namespace]
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_namespace.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_namespace.md?pixel)]()

View File

@ -70,6 +70,7 @@ kubectl patch pod valid-pod -type='json' -p='[{"op": "replace", "path": "/spec/c
``` ```
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to update -f, --filename=[]: Filename, directory, or URL to a file identifying the resource to update
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
-o, --output="": Output mode. Use "-o name" for shorter output (resource/name). -o, --output="": Output mode. Use "-o name" for shorter output (resource/name).
-p, --patch="": The patch to be applied to the resource JSON file. -p, --patch="": The patch to be applied to the resource JSON file.
--record[=false]: Record current kubectl command in the resource annotation. --record[=false]: Record current kubectl command in the resource annotation.
@ -108,7 +109,7 @@ kubectl patch pod valid-pod -type='json' -p='[{"op": "replace", "path": "/spec/c
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_patch.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_patch.md?pixel)]()

View File

@ -99,7 +99,7 @@ kubectl port-forward mypod 0:5000
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_port-forward.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_port-forward.md?pixel)]()

View File

@ -122,7 +122,7 @@ kubectl proxy --api-prefix=/k8s-api
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_proxy.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_proxy.md?pixel)]()

View File

@ -74,6 +74,7 @@ kubectl replace --force -f ./pod.json
-f, --filename=[]: Filename, directory, or URL to file to use to replace the resource. -f, --filename=[]: Filename, directory, or URL to file to use to replace the resource.
--force[=false]: Delete and re-create the specified resource --force[=false]: Delete and re-create the specified resource
--grace-period=-1: Only relevant during a force replace. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative. --grace-period=-1: Only relevant during a force replace. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative.
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
-o, --output="": Output mode. Use "-o name" for shorter output (resource/name). -o, --output="": Output mode. Use "-o name" for shorter output (resource/name).
--record[=false]: Record current kubectl command in the resource annotation. --record[=false]: Record current kubectl command in the resource annotation.
-R, --recursive[=false]: If true, process directory recursively. -R, --recursive[=false]: If true, process directory recursively.
@ -114,7 +115,7 @@ kubectl replace --force -f ./pod.json
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_replace.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_replace.md?pixel)]()

View File

@ -78,6 +78,7 @@ kubectl rolling-update frontend-v1 frontend-v2 --rollback
--dry-run[=false]: If true, print out the changes that would be made, but don't actually make them. --dry-run[=false]: If true, print out the changes that would be made, but don't actually make them.
-f, --filename=[]: Filename or URL to file to use to create the new replication controller. -f, --filename=[]: Filename or URL to file to use to create the new replication controller.
--image="": Image to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with --filename/-f --image="": Image to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with --filename/-f
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
--no-headers[=false]: When using the default output, don't print headers. --no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md]. -o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md].
--output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1'). --output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
@ -124,7 +125,7 @@ kubectl rolling-update frontend-v1 frontend-v2 --rollback
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rolling-update.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rolling-update.md?pixel)]()

View File

@ -87,7 +87,7 @@ kubectl rollout undo deployment/abc
* [kubectl rollout resume](kubectl_rollout_resume.md) - Resume a paused resource * [kubectl rollout resume](kubectl_rollout_resume.md) - Resume a paused resource
* [kubectl rollout undo](kubectl_rollout_undo.md) - undoes a previous rollout * [kubectl rollout undo](kubectl_rollout_undo.md) - undoes a previous rollout
###### Auto generated by spf13/cobra on 21-Mar-2016 ###### Auto generated by spf13/cobra on 25-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout.md?pixel)]()

View File

@ -94,7 +94,7 @@ kubectl rollout history deployment/abc --revision=3
* [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment * [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_history.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_history.md?pixel)]()

View File

@ -96,7 +96,7 @@ kubectl rollout pause deployment/nginx
* [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment * [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_pause.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_pause.md?pixel)]()

View File

@ -94,7 +94,7 @@ kubectl rollout resume deployment/nginx
* [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment * [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_resume.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_resume.md?pixel)]()

View File

@ -94,7 +94,7 @@ kubectl rollout undo deployment/abc --to-revision=3
* [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment * [kubectl rollout](kubectl_rollout.md) - rollout manages a deployment
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_undo.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rollout_undo.md?pixel)]()

View File

@ -91,6 +91,7 @@ kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print
--generator="": The name of the API generator to use. Default is 'deployment/v1beta1' if --restart=Always, otherwise the default is 'job/v1'. This will happen only for cluster version at least 1.2, for olders we will fallback to 'run/v1' for --restart=Always, 'run-pod/v1' for others. --generator="": The name of the API generator to use. Default is 'deployment/v1beta1' if --restart=Always, otherwise the default is 'job/v1'. This will happen only for cluster version at least 1.2, for olders we will fallback to 'run/v1' for --restart=Always, 'run-pod/v1' for others.
--hostport=-1: The host port mapping for the container port. To demonstrate a single-machine container. --hostport=-1: The host port mapping for the container port. To demonstrate a single-machine container.
--image="": The image for the container to run. --image="": The image for the container to run.
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
-l, --labels="": Labels to apply to the pod(s). -l, --labels="": Labels to apply to the pod(s).
--leave-stdin-open[=false]: If the pod is started in interactive mode or with stdin, leave stdin open after the first attach completes. By default, stdin will be closed after the first attach completes. --leave-stdin-open[=false]: If the pod is started in interactive mode or with stdin, leave stdin open after the first attach completes. By default, stdin will be closed after the first attach completes.
--limits="": The resource requirement limits for this container. For example, 'cpu=200m,memory=512Mi' --limits="": The resource requirement limits for this container. For example, 'cpu=200m,memory=512Mi'
@ -146,7 +147,7 @@ kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 11-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_run.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_run.md?pixel)]()

View File

@ -74,6 +74,7 @@ kubectl scale --replicas=3 job/cron
``` ```
--current-replicas=-1: Precondition for current size. Requires that the current size of the resource match this value in order to scale. --current-replicas=-1: Precondition for current size. Requires that the current size of the resource match this value in order to scale.
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to set a new size -f, --filename=[]: Filename, directory, or URL to a file identifying the resource to set a new size
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
-o, --output="": Output mode. Use "-o name" for shorter output (resource/name). -o, --output="": Output mode. Use "-o name" for shorter output (resource/name).
--record[=false]: Record current kubectl command in the resource annotation. --record[=false]: Record current kubectl command in the resource annotation.
-R, --recursive[=false]: If true, process directory recursively. -R, --recursive[=false]: If true, process directory recursively.
@ -113,7 +114,7 @@ kubectl scale --replicas=3 job/cron
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 28-Mar-2016 ###### Auto generated by spf13/cobra on 30-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_scale.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_scale.md?pixel)]()

View File

@ -85,7 +85,7 @@ $ kubectl uncordon foo
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 31-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_uncordon.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_uncordon.md?pixel)]()

View File

@ -82,7 +82,7 @@ kubectl version
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on 2-Mar-2016 ###### Auto generated by spf13/cobra on 23-Mar-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_version.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_version.md?pixel)]()

View File

@ -162,6 +162,7 @@ ignore-daemonsets
ignore-not-found ignore-not-found
image-gc-high-threshold image-gc-high-threshold
image-gc-low-threshold image-gc-low-threshold
include-extended-apis
input-dirs input-dirs
insecure-bind-address insecure-bind-address
insecure-port insecure-port

View File

@ -35,6 +35,10 @@ var (
// registeredGroupVersions stores all API group versions for which RegisterGroup is called. // registeredGroupVersions stores all API group versions for which RegisterGroup is called.
registeredVersions = map[unversioned.GroupVersion]struct{}{} registeredVersions = map[unversioned.GroupVersion]struct{}{}
// thirdPartyGroupVersions are API versions which are dynamically
// registered (and unregistered) via API calls to the apiserver
thirdPartyGroupVersions []unversioned.GroupVersion
// enabledVersions represents all enabled API versions. It should be a // enabledVersions represents all enabled API versions. It should be a
// subset of registeredVersions. Please call EnableVersions() to add // subset of registeredVersions. Please call EnableVersions() to add
// enabled versions. // enabled versions.
@ -158,6 +162,51 @@ func IsRegistered(group string) bool {
return found return found
} }
// IsRegisteredVersion returns if a version is registered.
func IsRegisteredVersion(v unversioned.GroupVersion) bool {
_, found := registeredVersions[v]
return found
}
// IsThirdPartyAPIGroupVersion returns true if the api version is a user-registered group/version.
func IsThirdPartyAPIGroupVersion(gv unversioned.GroupVersion) bool {
for ix := range thirdPartyGroupVersions {
if thirdPartyGroupVersions[ix] == gv {
return true
}
}
return false
}
// AddThirdPartyAPIGroupVersions sets the list of third party versions,
// registers them in the API machinery and enables them.
// Skips GroupVersions that are already registered.
// Returns the list of GroupVersions that were skipped.
func AddThirdPartyAPIGroupVersions(gvs ...unversioned.GroupVersion) []unversioned.GroupVersion {
filteredGVs := []unversioned.GroupVersion{}
skippedGVs := []unversioned.GroupVersion{}
for ix := range gvs {
if !IsRegisteredVersion(gvs[ix]) {
filteredGVs = append(filteredGVs, gvs[ix])
} else {
glog.V(3).Infof("Skipping %s, because its already registered", gvs[ix].String())
skippedGVs = append(skippedGVs, gvs[ix])
}
}
if len(filteredGVs) == 0 {
return skippedGVs
}
RegisterVersions(filteredGVs)
EnableVersions(filteredGVs...)
next := make([]unversioned.GroupVersion, len(gvs))
for ix := range filteredGVs {
next[ix] = filteredGVs[ix]
}
thirdPartyGroupVersions = next
return skippedGVs
}
// TODO: This is an expedient function, because we don't check if a Group is // TODO: This is an expedient function, because we don't check if a Group is
// supported throughout the code base. We will abandon this function and // supported throughout the code base. We will abandon this function and
// checking the error returned by the Group() function. // checking the error returned by the Group() function.

View File

@ -26,6 +26,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/flowcontrol" "k8s.io/kubernetes/pkg/util/flowcontrol"
) )
@ -159,3 +160,7 @@ func (c *RESTClient) Delete() *Request {
func (c *RESTClient) APIVersion() unversioned.GroupVersion { func (c *RESTClient) APIVersion() unversioned.GroupVersion {
return *c.contentConfig.GroupVersion return *c.contentConfig.GroupVersion
} }
func (c *RESTClient) Codec() runtime.Codec {
return c.contentConfig.Codec
}

View File

@ -110,6 +110,7 @@ func NewCmdAnnotate(f *cmdutil.Factory, out io.Writer) *cobra.Command {
}, },
} }
cmdutil.AddPrinterFlags(cmd) cmdutil.AddPrinterFlags(cmd)
cmdutil.AddInclude3rdPartyFlags(cmd)
cmd.Flags().StringVarP(&options.selector, "selector", "l", "", "Selector (label query) to filter on") cmd.Flags().StringVarP(&options.selector, "selector", "l", "", "Selector (label query) to filter on")
cmd.Flags().BoolVar(&options.overwrite, "overwrite", false, "If true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations.") cmd.Flags().BoolVar(&options.overwrite, "overwrite", false, "If true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations.")
cmd.Flags().BoolVar(&options.all, "all", false, "select all resources in the namespace of the specified resource types") cmd.Flags().BoolVar(&options.all, "all", false, "select all resources in the namespace of the specified resource types")
@ -161,7 +162,7 @@ func (o *AnnotateOptions) Complete(f *cmdutil.Factory, out io.Writer, cmd *cobra
o.recordChangeCause = cmdutil.GetRecordFlag(cmd) o.recordChangeCause = cmdutil.GetRecordFlag(cmd)
o.changeCause = f.Command() o.changeCause = f.Command()
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
o.builder = resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). o.builder = resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
ContinueOnError(). ContinueOnError().
NamespaceParam(namespace).DefaultNamespace(). NamespaceParam(namespace).DefaultNamespace().
@ -246,11 +247,13 @@ func (o AnnotateOptions) RunAnnotate() error {
if err != nil { if err != nil {
return err return err
} }
mapper, _ := o.f.Object(cmdutil.GetIncludeThirdPartyAPIs(o.cmd))
outputFormat := cmdutil.GetFlagString(o.cmd, "output") outputFormat := cmdutil.GetFlagString(o.cmd, "output")
if outputFormat != "" { if outputFormat != "" {
return o.f.PrintObject(o.cmd, outputObj, o.out) return o.f.PrintObject(o.cmd, mapper, outputObj, o.out)
} }
mapper, _ := o.f.Object()
cmdutil.PrintSuccess(mapper, false, o.out, info.Mapping.Resource, info.Name, "annotated") cmdutil.PrintSuccess(mapper, false, o.out, info.Mapping.Resource, info.Name, "annotated")
return nil return nil
}) })

View File

@ -72,6 +72,7 @@ func NewCmdApply(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmdutil.AddRecursiveFlag(cmd, &options.Recursive) cmdutil.AddRecursiveFlag(cmd, &options.Recursive)
cmdutil.AddOutputFlagsForMutation(cmd) cmdutil.AddOutputFlagsForMutation(cmd)
cmdutil.AddRecordFlag(cmd) cmdutil.AddRecordFlag(cmd)
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -95,7 +96,7 @@ func RunApply(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer, options *Ap
return err return err
} }
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
Schema(schema). Schema(schema).
ContinueOnError(). ContinueOnError().

View File

@ -74,6 +74,7 @@ func NewCmdAutoscale(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmdutil.AddRecursiveFlag(cmd, &options.Recursive) cmdutil.AddRecursiveFlag(cmd, &options.Recursive)
cmdutil.AddApplyAnnotationFlags(cmd) cmdutil.AddApplyAnnotationFlags(cmd)
cmdutil.AddRecordFlag(cmd) cmdutil.AddRecordFlag(cmd)
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -88,7 +89,7 @@ func RunAutoscale(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []
return err return err
} }
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
ContinueOnError(). ContinueOnError().
NamespaceParam(namespace).DefaultNamespace(). NamespaceParam(namespace).DefaultNamespace().
@ -157,7 +158,7 @@ func RunAutoscale(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []
} }
// TODO: extract this flag to a central location, when such a location exists. // TODO: extract this flag to a central location, when such a location exists.
if cmdutil.GetFlagBool(cmd, "dry-run") { if cmdutil.GetFlagBool(cmd, "dry-run") {
return f.PrintObject(cmd, object, out) return f.PrintObject(cmd, mapper, object, out)
} }
if err := kubectl.CreateOrUpdateAnnotation(cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag), hpa, f.JSONEncoder()); err != nil { if err := kubectl.CreateOrUpdateAnnotation(cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag), hpa, f.JSONEncoder()); err != nil {
@ -170,7 +171,7 @@ func RunAutoscale(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []
} }
if len(cmdutil.GetFlagString(cmd, "output")) > 0 { if len(cmdutil.GetFlagString(cmd, "output")) > 0 {
return f.PrintObject(cmd, object, out) return f.PrintObject(cmd, mapper, object, out)
} }
cmdutil.PrintSuccess(mapper, false, out, info.Mapping.Resource, info.Name, "autoscaled") cmdutil.PrintSuccess(mapper, false, out, info.Mapping.Resource, info.Name, "autoscaled")
return nil return nil

View File

@ -42,6 +42,7 @@ func NewCmdClusterInfo(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmdutil.CheckErr(err) cmdutil.CheckErr(err)
}, },
} }
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -56,7 +57,7 @@ func RunClusterInfo(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command) error
} }
printService(out, "Kubernetes master", client.Host) printService(out, "Kubernetes master", client.Host)
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
cmdNamespace := cmdutil.GetFlagString(cmd, "namespace") cmdNamespace := cmdutil.GetFlagString(cmd, "namespace")
if cmdNamespace == "" { if cmdNamespace == "" {
cmdNamespace = api.NamespaceSystem cmdNamespace = api.NamespaceSystem

View File

@ -180,7 +180,7 @@ func NewTestFactory() (*cmdutil.Factory, *testFactory, runtime.Codec) {
Typer: scheme, Typer: scheme,
} }
return &cmdutil.Factory{ return &cmdutil.Factory{
Object: func() (meta.RESTMapper, runtime.ObjectTyper) { Object: func(discovery bool) (meta.RESTMapper, runtime.ObjectTyper) {
priorityRESTMapper := meta.PriorityRESTMapper{ priorityRESTMapper := meta.PriorityRESTMapper{
Delegate: t.Mapper, Delegate: t.Mapper,
ResourcePriority: []unversioned.GroupVersionResource{ ResourcePriority: []unversioned.GroupVersionResource{
@ -221,7 +221,7 @@ func NewTestFactory() (*cmdutil.Factory, *testFactory, runtime.Codec) {
func NewMixedFactory(apiClient resource.RESTClient) (*cmdutil.Factory, *testFactory, runtime.Codec) { func NewMixedFactory(apiClient resource.RESTClient) (*cmdutil.Factory, *testFactory, runtime.Codec) {
f, t, c := NewTestFactory() f, t, c := NewTestFactory()
f.Object = func() (meta.RESTMapper, runtime.ObjectTyper) { f.Object = func(discovery bool) (meta.RESTMapper, runtime.ObjectTyper) {
priorityRESTMapper := meta.PriorityRESTMapper{ priorityRESTMapper := meta.PriorityRESTMapper{
Delegate: meta.MultiRESTMapper{t.Mapper, testapi.Default.RESTMapper()}, Delegate: meta.MultiRESTMapper{t.Mapper, testapi.Default.RESTMapper()},
ResourcePriority: []unversioned.GroupVersionResource{ ResourcePriority: []unversioned.GroupVersionResource{
@ -248,7 +248,7 @@ func NewAPIFactory() (*cmdutil.Factory, *testFactory, runtime.Codec) {
} }
f := &cmdutil.Factory{ f := &cmdutil.Factory{
Object: func() (meta.RESTMapper, runtime.ObjectTyper) { Object: func(discovery bool) (meta.RESTMapper, runtime.ObjectTyper) {
return testapi.Default.RESTMapper(), api.Scheme return testapi.Default.RESTMapper(), api.Scheme
}, },
Client: func() (*client.Client, error) { Client: func() (*client.Client, error) {
@ -380,7 +380,8 @@ func ExamplePrintReplicationControllerWithNamespace() {
Replicas: 1, Replicas: 1,
}, },
} }
err := f.PrintObject(cmd, ctrl, os.Stdout) mapper, _ := f.Object(false)
err := f.PrintObject(cmd, mapper, ctrl, os.Stdout)
if err != nil { if err != nil {
fmt.Printf("Unexpected error: %v", err) fmt.Printf("Unexpected error: %v", err)
} }
@ -428,7 +429,8 @@ func ExamplePrintMultiContainersReplicationControllerWithWide() {
Replicas: 1, Replicas: 1,
}, },
} }
err := f.PrintObject(cmd, ctrl, os.Stdout) mapper, _ := f.Object(false)
err := f.PrintObject(cmd, mapper, ctrl, os.Stdout)
if err != nil { if err != nil {
fmt.Printf("Unexpected error: %v", err) fmt.Printf("Unexpected error: %v", err)
} }
@ -476,7 +478,8 @@ func ExamplePrintReplicationController() {
Replicas: 1, Replicas: 1,
}, },
} }
err := f.PrintObject(cmd, ctrl, os.Stdout) mapper, _ := f.Object(false)
err := f.PrintObject(cmd, mapper, ctrl, os.Stdout)
if err != nil { if err != nil {
fmt.Printf("Unexpected error: %v", err) fmt.Printf("Unexpected error: %v", err)
} }
@ -511,7 +514,8 @@ func ExamplePrintPodWithWideFormat() {
}, },
}, },
} }
err := f.PrintObject(cmd, pod, os.Stdout) mapper, _ := f.Object(false)
err := f.PrintObject(cmd, mapper, pod, os.Stdout)
if err != nil { if err != nil {
fmt.Printf("Unexpected error: %v", err) fmt.Printf("Unexpected error: %v", err)
} }
@ -550,7 +554,8 @@ func ExamplePrintPodWithShowLabels() {
}, },
}, },
} }
err := f.PrintObject(cmd, pod, os.Stdout) mapper, _ := f.Object(false)
err := f.PrintObject(cmd, mapper, pod, os.Stdout)
if err != nil { if err != nil {
fmt.Printf("Unexpected error: %v", err) fmt.Printf("Unexpected error: %v", err)
} }
@ -660,7 +665,8 @@ func ExamplePrintPodHideTerminated() {
} }
cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr) cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr)
podList := newAllPhasePodList() podList := newAllPhasePodList()
err := f.PrintObject(cmd, podList, os.Stdout) mapper, _ := f.Object(false)
err := f.PrintObject(cmd, mapper, podList, os.Stdout)
if err != nil { if err != nil {
fmt.Printf("Unexpected error: %v", err) fmt.Printf("Unexpected error: %v", err)
} }
@ -680,7 +686,8 @@ func ExamplePrintPodShowAll() {
} }
cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr) cmd := NewCmdRun(f, os.Stdin, os.Stdout, os.Stderr)
podList := newAllPhasePodList() podList := newAllPhasePodList()
err := f.PrintObject(cmd, podList, os.Stdout) mapper, _ := f.Object(false)
err := f.PrintObject(cmd, mapper, podList, os.Stdout)
if err != nil { if err != nil {
fmt.Printf("Unexpected error: %v", err) fmt.Printf("Unexpected error: %v", err)
} }
@ -748,7 +755,9 @@ func ExamplePrintServiceWithNamespacesAndLabels() {
} }
ld := util.NewLineDelimiter(os.Stdout, "|") ld := util.NewLineDelimiter(os.Stdout, "|")
defer ld.Flush() defer ld.Flush()
err := f.PrintObject(cmd, svc, ld)
mapper, _ := f.Object(false)
err := f.PrintObject(cmd, mapper, svc, ld)
if err != nil { if err != nil {
fmt.Printf("Unexpected error: %v", err) fmt.Printf("Unexpected error: %v", err)
} }

View File

@ -79,7 +79,7 @@ func NewCmdConvert(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmdutil.AddValidateFlags(cmd) cmdutil.AddValidateFlags(cmd)
cmdutil.AddPrinterFlags(cmd) cmdutil.AddPrinterFlags(cmd)
cmd.Flags().BoolVar(&options.local, "local", true, "If true, convert will NOT try to contact api-server but run locally.") cmd.Flags().BoolVar(&options.local, "local", true, "If true, convert will NOT try to contact api-server but run locally.")
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -109,8 +109,9 @@ func (o *ConvertOptions) Complete(f *cmdutil.Factory, out io.Writer, cmd *cobra.
} }
// build the builder // build the builder
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
clientMapper := resource.ClientMapperFunc(f.ClientForMapping) clientMapper := resource.ClientMapperFunc(f.ClientForMapping)
if o.local { if o.local {
fmt.Fprintln(out, "running in local mode...") fmt.Fprintln(out, "running in local mode...")
o.builder = resource.NewBuilder(mapper, typer, resource.DisabledClientForMapping{ClientMapper: clientMapper}, f.Decoder(true)) o.builder = resource.NewBuilder(mapper, typer, resource.DisabledClientForMapping{ClientMapper: clientMapper}, f.Decoder(true))

View File

@ -76,6 +76,7 @@ func NewCmdCreate(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmdutil.AddOutputFlagsForMutation(cmd) cmdutil.AddOutputFlagsForMutation(cmd)
cmdutil.AddApplyAnnotationFlags(cmd) cmdutil.AddApplyAnnotationFlags(cmd)
cmdutil.AddRecordFlag(cmd) cmdutil.AddRecordFlag(cmd)
cmdutil.AddInclude3rdPartyFlags(cmd)
// create subcommands // create subcommands
cmd.AddCommand(NewCmdCreateNamespace(f, out)) cmd.AddCommand(NewCmdCreateNamespace(f, out))
@ -103,7 +104,7 @@ func RunCreate(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer, options *C
return err return err
} }
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
Schema(schema). Schema(schema).
ContinueOnError(). ContinueOnError().
@ -223,7 +224,7 @@ func RunCreateSubcommand(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer,
if err != nil { if err != nil {
return err return err
} }
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
gvk, err := typer.ObjectKind(obj) gvk, err := typer.ObjectKind(obj)
mapping, err := mapper.RESTMapping(unversioned.GroupKind{Group: gvk.Group, Kind: gvk.Kind}, gvk.Version) mapping, err := mapper.RESTMapping(unversioned.GroupKind{Group: gvk.Group, Kind: gvk.Kind}, gvk.Version)
if err != nil { if err != nil {
@ -257,5 +258,5 @@ func RunCreateSubcommand(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer,
return nil return nil
} }
return f.PrintObject(cmd, obj, out) return f.PrintObject(cmd, mapper, obj, out)
} }

View File

@ -51,6 +51,7 @@ func NewCmdCreateNamespace(f *cmdutil.Factory, cmdOut io.Writer) *cobra.Command
cmdutil.AddValidateFlags(cmd) cmdutil.AddValidateFlags(cmd)
cmdutil.AddPrinterFlags(cmd) cmdutil.AddPrinterFlags(cmd)
cmdutil.AddGeneratorFlags(cmd, cmdutil.NamespaceV1GeneratorName) cmdutil.AddGeneratorFlags(cmd, cmdutil.NamespaceV1GeneratorName)
return cmd return cmd
} }

View File

@ -38,6 +38,7 @@ func NewCmdCreateSecret(f *cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
} }
cmd.AddCommand(NewCmdCreateSecretDockerRegistry(f, cmdOut)) cmd.AddCommand(NewCmdCreateSecretDockerRegistry(f, cmdOut))
cmd.AddCommand(NewCmdCreateSecretGeneric(f, cmdOut)) cmd.AddCommand(NewCmdCreateSecretGeneric(f, cmdOut))
return cmd return cmd
} }
@ -155,6 +156,7 @@ func NewCmdCreateSecretDockerRegistry(f *cmdutil.Factory, cmdOut io.Writer) *cob
cmd.Flags().String("docker-email", "", "Email for Docker registry") cmd.Flags().String("docker-email", "", "Email for Docker registry")
cmd.MarkFlagRequired("docker-email") cmd.MarkFlagRequired("docker-email")
cmd.Flags().String("docker-server", "https://index.docker.io/v1/", "Server location for Docker registry") cmd.Flags().String("docker-server", "https://index.docker.io/v1/", "Server location for Docker registry")
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }

View File

@ -50,6 +50,7 @@ func NewCmdCreateServiceAccount(f *cmdutil.Factory, cmdOut io.Writer) *cobra.Com
cmdutil.AddApplyAnnotationFlags(cmd) cmdutil.AddApplyAnnotationFlags(cmd)
cmdutil.AddValidateFlags(cmd) cmdutil.AddValidateFlags(cmd)
cmdutil.AddPrinterFlags(cmd) cmdutil.AddPrinterFlags(cmd)
cmdutil.AddInclude3rdPartyFlags(cmd)
cmdutil.AddGeneratorFlags(cmd, cmdutil.ServiceAccountV1GeneratorName) cmdutil.AddGeneratorFlags(cmd, cmdutil.ServiceAccountV1GeneratorName)
return cmd return cmd
} }

View File

@ -100,6 +100,7 @@ func NewCmdDelete(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd.Flags().Int("grace-period", -1, "Period of time in seconds given to the resource to terminate gracefully. Ignored if negative.") cmd.Flags().Int("grace-period", -1, "Period of time in seconds given to the resource to terminate gracefully. Ignored if negative.")
cmd.Flags().Duration("timeout", 0, "The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object") cmd.Flags().Duration("timeout", 0, "The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object")
cmdutil.AddOutputFlagsForMutation(cmd) cmdutil.AddOutputFlagsForMutation(cmd)
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -109,7 +110,7 @@ func RunDelete(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str
return err return err
} }
deleteAll := cmdutil.GetFlagBool(cmd, "all") deleteAll := cmdutil.GetFlagBool(cmd, "all")
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
ContinueOnError(). ContinueOnError().
NamespaceParam(cmdNamespace).DefaultNamespace(). NamespaceParam(cmdNamespace).DefaultNamespace().

View File

@ -89,6 +89,7 @@ func NewCmdDescribe(f *cmdutil.Factory, out io.Writer) *cobra.Command {
kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage) kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage)
cmdutil.AddRecursiveFlag(cmd, &options.Recursive) cmdutil.AddRecursiveFlag(cmd, &options.Recursive)
cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on") cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on")
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -103,7 +104,7 @@ func RunDescribe(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []s
return cmdutil.UsageError(cmd, "Required resource not specified.") return cmdutil.UsageError(cmd, "Required resource not specified.")
} }
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
ContinueOnError(). ContinueOnError().
NamespaceParam(cmdNamespace).DefaultNamespace(). NamespaceParam(cmdNamespace).DefaultNamespace().

View File

@ -60,7 +60,7 @@ kubectl cordon foo
func NewCmdCordon(f *cmdutil.Factory, out io.Writer) *cobra.Command { func NewCmdCordon(f *cmdutil.Factory, out io.Writer) *cobra.Command {
options := &DrainOptions{factory: f, out: out} options := &DrainOptions{factory: f, out: out}
return &cobra.Command{ cmd := &cobra.Command{
Use: "cordon NODE", Use: "cordon NODE",
Short: "Mark node as unschedulable", Short: "Mark node as unschedulable",
Long: cordon_long, Long: cordon_long,
@ -70,6 +70,7 @@ func NewCmdCordon(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmdutil.CheckErr(options.RunCordonOrUncordon(true)) cmdutil.CheckErr(options.RunCordonOrUncordon(true))
}, },
} }
return cmd
} }
const ( const (
@ -83,7 +84,7 @@ $ kubectl uncordon foo
func NewCmdUncordon(f *cmdutil.Factory, out io.Writer) *cobra.Command { func NewCmdUncordon(f *cmdutil.Factory, out io.Writer) *cobra.Command {
options := &DrainOptions{factory: f, out: out} options := &DrainOptions{factory: f, out: out}
return &cobra.Command{ cmd := &cobra.Command{
Use: "uncordon NODE", Use: "uncordon NODE",
Short: "Mark node as schedulable", Short: "Mark node as schedulable",
Long: uncordon_long, Long: uncordon_long,
@ -93,6 +94,7 @@ func NewCmdUncordon(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmdutil.CheckErr(options.RunCordonOrUncordon(false)) cmdutil.CheckErr(options.RunCordonOrUncordon(false))
}, },
} }
return cmd
} }
const ( const (
@ -149,14 +151,14 @@ func (o *DrainOptions) SetupDrain(cmd *cobra.Command, args []string) error {
return err return err
} }
o.mapper, o.typer = o.factory.Object() o.mapper, o.typer = o.factory.Object(false)
cmdNamespace, _, err := o.factory.DefaultNamespace() cmdNamespace, _, err := o.factory.DefaultNamespace()
if err != nil { if err != nil {
return err return err
} }
r := o.factory.NewBuilder(). r := o.factory.NewBuilder(cmdutil.GetIncludeThirdPartyAPIs(cmd)).
NamespaceParam(cmdNamespace).DefaultNamespace(). NamespaceParam(cmdNamespace).DefaultNamespace().
ResourceNames("node", args[0]). ResourceNames("node", args[0]).
Do() Do()

View File

@ -107,6 +107,7 @@ func NewCmdEdit(f *cmdutil.Factory, out, errOut io.Writer) *cobra.Command {
cmd.Flags().Bool("windows-line-endings", gruntime.GOOS == "windows", "Use Windows line-endings (default Unix line-endings)") cmd.Flags().Bool("windows-line-endings", gruntime.GOOS == "windows", "Use Windows line-endings (default Unix line-endings)")
cmdutil.AddApplyAnnotationFlags(cmd) cmdutil.AddApplyAnnotationFlags(cmd)
cmdutil.AddRecordFlag(cmd) cmdutil.AddRecordFlag(cmd)
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -129,7 +130,7 @@ func RunEdit(f *cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args
return err return err
} }
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
resourceMapper := &resource.Mapper{ resourceMapper := &resource.Mapper{
ObjectTyper: typer, ObjectTyper: typer,
RESTMapper: mapper, RESTMapper: mapper,

View File

@ -52,6 +52,7 @@ func NewCmdExplain(f *cmdutil.Factory, out io.Writer) *cobra.Command {
}, },
} }
cmd.Flags().Bool("recursive", false, "Print the fields of fields (Currently only 1 level deep)") cmd.Flags().Bool("recursive", false, "Print the fields of fields (Currently only 1 level deep)")
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -65,7 +66,7 @@ func RunExplain(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []st
apiVersionString := cmdutil.GetFlagString(cmd, "api-version") apiVersionString := cmdutil.GetFlagString(cmd, "api-version")
apiVersion := unversioned.GroupVersion{} apiVersion := unversioned.GroupVersion{}
mapper, _ := f.Object() mapper, _ := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
// TODO: After we figured out the new syntax to separate group and resource, allow // TODO: After we figured out the new syntax to separate group and resource, allow
// the users to use it in explain (kubectl explain <group><syntax><resource>). // the users to use it in explain (kubectl explain <group><syntax><resource>).
// Refer to issue #16039 for why we do this. Refer to PR #15808 that used "/" syntax. // Refer to issue #16039 for why we do this. Refer to PR #15808 that used "/" syntax.

View File

@ -115,7 +115,7 @@ func RunExpose(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str
return err return err
} }
mapper, typer := f.Object() mapper, typer := f.Object(false)
r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
ContinueOnError(). ContinueOnError().
NamespaceParam(namespace).DefaultNamespace(). NamespaceParam(namespace).DefaultNamespace().
@ -229,7 +229,7 @@ func RunExpose(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str
info.Refresh(object, true) info.Refresh(object, true)
// TODO: extract this flag to a central location, when such a location exists. // TODO: extract this flag to a central location, when such a location exists.
if cmdutil.GetFlagBool(cmd, "dry-run") { if cmdutil.GetFlagBool(cmd, "dry-run") {
return f.PrintObject(cmd, object, out) return f.PrintObject(cmd, mapper, object, out)
} }
if err := kubectl.CreateOrUpdateAnnotation(cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag), info, f.JSONEncoder()); err != nil { if err := kubectl.CreateOrUpdateAnnotation(cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag), info, f.JSONEncoder()); err != nil {
return err return err
@ -242,7 +242,7 @@ func RunExpose(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str
} }
if len(cmdutil.GetFlagString(cmd, "output")) > 0 { if len(cmdutil.GetFlagString(cmd, "output")) > 0 {
return f.PrintObject(cmd, object, out) return f.PrintObject(cmd, mapper, object, out)
} }
cmdutil.PrintSuccess(mapper, false, out, info.Mapping.Resource, info.Name, "exposed") cmdutil.PrintSuccess(mapper, false, out, info.Mapping.Resource, info.Name, "exposed")
return nil return nil

View File

@ -102,6 +102,7 @@ func NewCmdGet(f *cmdutil.Factory, out io.Writer) *cobra.Command {
usage := "Filename, directory, or URL to a file identifying the resource to get from a server." usage := "Filename, directory, or URL to a file identifying the resource to get from a server."
kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage) kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage)
cmdutil.AddRecursiveFlag(cmd, &options.Recursive) cmdutil.AddRecursiveFlag(cmd, &options.Recursive)
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -110,7 +111,7 @@ func NewCmdGet(f *cmdutil.Factory, out io.Writer) *cobra.Command {
func RunGet(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *GetOptions) error { func RunGet(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *GetOptions) error {
selector := cmdutil.GetFlagString(cmd, "selector") selector := cmdutil.GetFlagString(cmd, "selector")
allNamespaces := cmdutil.GetFlagBool(cmd, "all-namespaces") allNamespaces := cmdutil.GetFlagBool(cmd, "all-namespaces")
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
cmdNamespace, enforceNamespace, err := f.DefaultNamespace() cmdNamespace, enforceNamespace, err := f.DefaultNamespace()
if err != nil { if err != nil {

View File

@ -100,6 +100,7 @@ func NewCmdLabel(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmdutil.AddRecursiveFlag(cmd, &options.Recursive) cmdutil.AddRecursiveFlag(cmd, &options.Recursive)
cmd.Flags().Bool("dry-run", false, "If true, only print the object that would be sent, without sending it.") cmd.Flags().Bool("dry-run", false, "If true, only print the object that would be sent, without sending it.")
cmdutil.AddRecordFlag(cmd) cmdutil.AddRecordFlag(cmd)
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -204,8 +205,7 @@ func RunLabel(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri
if err != nil { if err != nil {
return cmdutil.UsageError(cmd, err.Error()) return cmdutil.UsageError(cmd, err.Error())
} }
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
b := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). b := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
ContinueOnError(). ContinueOnError().
NamespaceParam(cmdNamespace).DefaultNamespace(). NamespaceParam(cmdNamespace).DefaultNamespace().
@ -296,7 +296,7 @@ func RunLabel(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri
} }
outputFormat := cmdutil.GetFlagString(cmd, "output") outputFormat := cmdutil.GetFlagString(cmd, "output")
if outputFormat != "" { if outputFormat != "" {
return f.PrintObject(cmd, outputObj, out) return f.PrintObject(cmd, mapper, outputObj, out)
} }
cmdutil.PrintSuccess(mapper, false, out, info.Mapping.Resource, info.Name, dataChangeMsg) cmdutil.PrintSuccess(mapper, false, out, info.Mapping.Resource, info.Name, dataChangeMsg)
return nil return nil

View File

@ -101,6 +101,7 @@ func NewCmdLogs(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd.Flags().Bool("interactive", false, "If true, prompt the user for input when required.") cmd.Flags().Bool("interactive", false, "If true, prompt the user for input when required.")
cmd.Flags().MarkDeprecated("interactive", "This flag is no longer respected and there is no replacement.") cmd.Flags().MarkDeprecated("interactive", "This flag is no longer respected and there is no replacement.")
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -155,7 +156,7 @@ func (o *LogsOptions) Complete(f *cmdutil.Factory, out io.Writer, cmd *cobra.Com
o.ClientMapper = resource.ClientMapperFunc(f.ClientForMapping) o.ClientMapper = resource.ClientMapperFunc(f.ClientForMapping)
o.Out = out o.Out = out
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
decoder := f.Decoder(true) decoder := f.Decoder(true)
if o.Object == nil { if o.Object == nil {
infos, err := resource.NewBuilder(mapper, typer, o.ClientMapper, decoder). infos, err := resource.NewBuilder(mapper, typer, o.ClientMapper, decoder).

View File

@ -80,6 +80,7 @@ func NewCmdPatch(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd.Flags().String("type", "strategic", fmt.Sprintf("The type of patch being provided; one of %v", sets.StringKeySet(patchTypes).List())) cmd.Flags().String("type", "strategic", fmt.Sprintf("The type of patch being provided; one of %v", sets.StringKeySet(patchTypes).List()))
cmdutil.AddOutputFlagsForMutation(cmd) cmdutil.AddOutputFlagsForMutation(cmd)
cmdutil.AddRecordFlag(cmd) cmdutil.AddRecordFlag(cmd)
cmdutil.AddInclude3rdPartyFlags(cmd)
usage := "Filename, directory, or URL to a file identifying the resource to update" usage := "Filename, directory, or URL to a file identifying the resource to update"
kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage) kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage)
@ -112,7 +113,7 @@ func RunPatch(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri
return fmt.Errorf("unable to parse %q: %v", patch, err) return fmt.Errorf("unable to parse %q: %v", patch, err)
} }
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
ContinueOnError(). ContinueOnError().
NamespaceParam(cmdNamespace).DefaultNamespace(). NamespaceParam(cmdNamespace).DefaultNamespace().

View File

@ -87,6 +87,8 @@ func NewCmdReplace(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmdutil.AddOutputFlagsForMutation(cmd) cmdutil.AddOutputFlagsForMutation(cmd)
cmdutil.AddApplyAnnotationFlags(cmd) cmdutil.AddApplyAnnotationFlags(cmd)
cmdutil.AddRecordFlag(cmd) cmdutil.AddRecordFlag(cmd)
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -114,7 +116,7 @@ func RunReplace(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []st
return forceReplace(f, out, cmd, args, shortOutput, options) return forceReplace(f, out, cmd, args, shortOutput, options)
} }
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
Schema(schema). Schema(schema).
ContinueOnError(). ContinueOnError().
@ -182,7 +184,7 @@ func forceReplace(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []
} }
} }
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)). r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
ContinueOnError(). ContinueOnError().
NamespaceParam(cmdNamespace).DefaultNamespace(). NamespaceParam(cmdNamespace).DefaultNamespace().

View File

@ -102,6 +102,8 @@ func NewCmdRollingUpdate(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd.Flags().Bool("rollback", false, "If true, this is a request to abort an existing rollout that is partially rolled out. It effectively reverses current and next and runs a rollout") cmd.Flags().Bool("rollback", false, "If true, this is a request to abort an existing rollout that is partially rolled out. It effectively reverses current and next and runs a rollout")
cmdutil.AddValidateFlags(cmd) cmdutil.AddValidateFlags(cmd)
cmdutil.AddPrinterFlags(cmd) cmdutil.AddPrinterFlags(cmd)
cmdutil.AddInclude3rdPartyFlags(cmd)
return cmd return cmd
} }
@ -190,7 +192,7 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg
var keepOldName bool var keepOldName bool
var replicasDefaulted bool var replicasDefaulted bool
mapper, typer := f.Object() mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
if len(filename) != 0 { if len(filename) != 0 {
schema, err := f.Validator(cmdutil.GetFlagBool(cmd, "validate"), cmdutil.GetFlagString(cmd, "schema-cache-dir")) schema, err := f.Validator(cmdutil.GetFlagBool(cmd, "validate"), cmdutil.GetFlagString(cmd, "schema-cache-dir"))
@ -311,10 +313,10 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg
oldRcData.WriteString(oldRc.Name) oldRcData.WriteString(oldRc.Name)
newRcData.WriteString(newRc.Name) newRcData.WriteString(newRc.Name)
} else { } else {
if err := f.PrintObject(cmd, oldRc, oldRcData); err != nil { if err := f.PrintObject(cmd, mapper, oldRc, oldRcData); err != nil {
return err return err
} }
if err := f.PrintObject(cmd, newRc, newRcData); err != nil { if err := f.PrintObject(cmd, mapper, newRc, newRcData); err != nil {
return err return err
} }
} }
@ -359,7 +361,7 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg
return err return err
} }
if outputFormat != "" { if outputFormat != "" {
return f.PrintObject(cmd, newRc, out) return f.PrintObject(cmd, mapper, newRc, out)
} }
kind, err := api.Scheme.ObjectKind(newRc) kind, err := api.Scheme.ObjectKind(newRc)
if err != nil { if err != nil {

View File

@ -43,7 +43,6 @@ func NewCmdRollout(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd.Help() cmd.Help()
}, },
} }
// subcommands // subcommands
cmd.AddCommand(NewCmdRolloutHistory(f, out)) cmd.AddCommand(NewCmdRolloutHistory(f, out))
cmd.AddCommand(NewCmdRolloutPause(f, out)) cmd.AddCommand(NewCmdRolloutPause(f, out))

View File

@ -70,7 +70,7 @@ func RunHistory(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer, args []st
} }
revisionDetail := cmdutil.GetFlagInt64(cmd, "revision") revisionDetail := cmdutil.GetFlagInt64(cmd, "revision")
mapper, typer := f.Object() mapper, typer := f.Object(false)
cmdNamespace, enforceNamespace, err := f.DefaultNamespace() cmdNamespace, enforceNamespace, err := f.DefaultNamespace()
if err != nil { if err != nil {

View File

@ -80,7 +80,7 @@ func (o *PauseConfig) CompletePause(f *cmdutil.Factory, cmd *cobra.Command, out
return cmdutil.UsageError(cmd, cmd.Use) return cmdutil.UsageError(cmd, cmd.Use)
} }
o.Mapper, o.Typer = f.Object() o.Mapper, o.Typer = f.Object(false)
o.PauseObject = f.PauseObject o.PauseObject = f.PauseObject
o.Out = out o.Out = out

Some files were not shown because too many files have changed in this diff Show More