Make --validate default on and shows how to turn if off

pull/6/head
Janet Kuo 2015-08-17 18:15:34 -07:00
parent 4d10def14f
commit 5823ef771b
73 changed files with 1247 additions and 206 deletions

View File

@ -347,6 +347,7 @@ _kubectl_create()
flags+=("-h")
flags+=("--output=")
two_word_flags+=("-o")
flags+=("--validate")
must_have_one_flag=()
must_have_one_flag+=("--filename=")
@ -378,6 +379,7 @@ _kubectl_replace()
flags+=("--output=")
two_word_flags+=("-o")
flags+=("--timeout=")
flags+=("--validate")
must_have_one_flag=()
must_have_one_flag+=("--filename=")
@ -537,6 +539,7 @@ _kubectl_rolling-update()
two_word_flags+=("-t")
flags+=("--timeout=")
flags+=("--update-period=")
flags+=("--validate")
must_have_one_flag=()
must_have_one_flag+=("--filename=")
@ -1149,7 +1152,6 @@ _kubectl()
flags+=("--user=")
flags+=("--username=")
flags+=("--v=")
flags+=("--validate")
flags+=("--vmodule=")
must_have_one_flag=()

View File

@ -165,10 +165,6 @@ resourcequotas (quota) or secrets.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -111,10 +111,6 @@ Print available API versions.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -123,10 +123,6 @@ Attach to a a process that is already running inside an existing container.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -111,10 +111,6 @@ Display addresses of the master and services with label kubernetes.io/cluster\-s
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -116,10 +116,6 @@ Specifying a name that already exists will merge new fields on top of existing v
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -112,10 +112,6 @@ Specifying a name that already exists will merge new fields on top of existing v
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -131,10 +131,6 @@ Bearer token and basic auth are mutually exclusive.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -113,10 +113,6 @@ PROPERTY\_VALUE is the new value you wish to set.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -112,10 +112,6 @@ PROPERTY\_NAME is a dot delimited name where each token represents either a attr
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -111,10 +111,6 @@ Sets the current\-context in a kubeconfig file
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -156,10 +156,6 @@ You can use \-\-output=template \-\-template=TEMPLATE to extract specific values
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -117,10 +117,6 @@ The loading order follows these rules:
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -32,6 +32,10 @@ JSON and YAML formats are accepted.
\fB\-o\fP, \fB\-\-output\fP=""
Output mode. Use "\-o name" for shorter output (resource/name).
.PP
\fB\-\-validate\fP=true
If true, use a schema to validate the input before sending it
.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
@ -122,10 +126,6 @@ JSON and YAML formats are accepted.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -154,10 +154,6 @@ will be lost along with the rest of the resource.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -136,10 +136,6 @@ namespaces (ns) or secrets.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -127,10 +127,6 @@ Execute a command in a container.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -202,10 +202,6 @@ re\-use the labels from the resource it exposes.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -171,10 +171,6 @@ of the \-\-template flag, you can filter the attributes of the fetched resource(
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -162,10 +162,6 @@ If \-\-resource\-version is specified, then updates will use this resource versi
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -127,10 +127,6 @@ Print the logs for a container in a pod. If the pod has only one container, the
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -114,10 +114,6 @@ namespace has been superseded by the context.namespace field of .kubeconfig file
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -130,10 +130,6 @@ Please refer to the models in
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -115,10 +115,6 @@ Forward one or more local ports to a pod.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -172,10 +172,6 @@ The above lets you 'curl localhost:8001/custom/api/v1/pods'
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -54,6 +54,10 @@ Please refer to the models in
\fB\-\-timeout\fP=0
Only relevant during a force replace. The length of time to wait before giving up on a delete of the old resource, zero means determine a timeout from the size of the object
.PP
\fB\-\-validate\fP=true
If true, use a schema to validate the input before sending it
.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
@ -144,10 +148,6 @@ Please refer to the models in
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -84,6 +84,10 @@ existing replication controller and overwrite at least one (common) label in its
\fB\-\-update\-period\fP=1m0s
Time to wait between updating pods. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
.PP
\fB\-\-validate\fP=true
If true, use a schema to validate the input before sending it
.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
@ -174,10 +178,6 @@ existing replication controller and overwrite at least one (common) label in its
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -190,10 +190,6 @@ Creates a replication controller to manage the created container(s).
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -141,10 +141,6 @@ scale is sent to the server.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -147,10 +147,6 @@ If the resource is scalable it will be scaled to 0 before deletion.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -115,10 +115,6 @@ Print the client and server version information.
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

View File

@ -113,10 +113,6 @@ Find more information at
\fB\-\-v\fP=0
log level for V logs
.PP
\fB\-\-validate\fP=false
If true, use a schema to validate the input before sending it
.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging

File diff suppressed because it is too large Load Diff

View File

@ -72,7 +72,6 @@ kubectl
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -102,7 +101,7 @@ kubectl
* [kubectl stop](kubectl_stop.md) - Deprecated: Gracefully shut down a resource by name or filename.
* [kubectl version](kubectl_version.md) - Print the client and server version information.
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.481555644 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.169032754 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl.md?pixel)]()

View File

@ -119,7 +119,6 @@ $ kubectl annotate pods foo description-
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```

View File

@ -75,7 +75,6 @@ kubectl api-versions
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -83,7 +82,7 @@ kubectl api-versions
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.481201276 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.168773226 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_api-versions.md?pixel)]()

View File

@ -92,7 +92,6 @@ $ kubectl attach 123456-7890 -c ruby-container -i -t
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -100,7 +99,7 @@ $ kubectl attach 123456-7890 -c ruby-container -i -t
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.477447179 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.165905157 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_attach.md?pixel)]()

View File

@ -75,7 +75,6 @@ kubectl cluster-info
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -83,7 +82,7 @@ kubectl cluster-info
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.481057477 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.168659453 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_cluster-info.md?pixel)]()

View File

@ -81,7 +81,6 @@ kubectl config SUBCOMMAND
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -96,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 view](kubectl_config_view.md) - displays Merged kubeconfig settings or a specified kubeconfig file.
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.480913444 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.16853102 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config.md?pixel)]()

View File

@ -90,7 +90,6 @@ $ kubectl config set-cluster e2e --insecure-skip-tls-verify=true
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -98,7 +97,7 @@ $ kubectl config set-cluster e2e --insecure-skip-tls-verify=true
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.479946549 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.167359915 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-cluster.md?pixel)]()

View File

@ -83,7 +83,6 @@ $ kubectl config set-context gce --user=cluster-admin
--token="": Bearer token for authentication to the API server.
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -91,7 +90,7 @@ $ kubectl config set-context gce --user=cluster-admin
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.480303261 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.168034038 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-context.md?pixel)]()

View File

@ -103,7 +103,6 @@ $ kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admi
--stderrthreshold=2: logs at or above this threshold go to stderr
--user="": The name of the kubeconfig user to use
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -111,7 +110,7 @@ $ kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admi
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.480107057 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.167500874 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-credentials.md?pixel)]()

View File

@ -77,7 +77,6 @@ kubectl config set PROPERTY_NAME PROPERTY_VALUE
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -85,7 +84,7 @@ kubectl config set PROPERTY_NAME PROPERTY_VALUE
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.480452342 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.16816699 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set.md?pixel)]()

View File

@ -76,7 +76,6 @@ kubectl config unset PROPERTY_NAME
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -84,7 +83,7 @@ kubectl config unset PROPERTY_NAME
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.480598704 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.168279315 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_unset.md?pixel)]()

View File

@ -75,7 +75,6 @@ kubectl config use-context CONTEXT_NAME
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -83,7 +82,7 @@ kubectl config use-context CONTEXT_NAME
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.480752945 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.168411074 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_use-context.md?pixel)]()

View File

@ -97,7 +97,6 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -105,7 +104,7 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-21 17:04:52.393094162 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-25 10:17:24.594231276 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_view.md?pixel)]()

View File

@ -62,6 +62,7 @@ $ cat pod.json | kubectl create -f -
-f, --filename=[]: Filename, directory, or URL to file to use to create the resource
-h, --help[=false]: help for create
-o, --output="": Output mode. Use "-o name" for shorter output (resource/name).
--validate[=true]: If true, use a schema to validate the input before sending it
```
### Options inherited from parent commands
@ -89,7 +90,6 @@ $ cat pod.json | kubectl create -f -
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -97,7 +97,7 @@ $ cat pod.json | kubectl create -f -
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.475503857 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.164310684 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create.md?pixel)]()

View File

@ -113,7 +113,6 @@ $ kubectl delete pods --all
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -121,7 +120,7 @@ $ kubectl delete pods --all
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-21 06:18:47.444397685 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-25 10:17:24.591839542 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_delete.md?pixel)]()

View File

@ -113,7 +113,6 @@ $ kubectl describe pods frontend
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```

View File

@ -93,7 +93,6 @@ $ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -101,7 +100,7 @@ $ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.477614406 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.166032952 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_exec.md?pixel)]()

View File

@ -116,7 +116,6 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -124,7 +123,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-21 17:04:52.392625597 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-25 10:17:24.593785768 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_expose.md?pixel)]()

View File

@ -123,7 +123,6 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -131,7 +130,7 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-21 17:04:52.389792296 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-25 10:17:24.591177912 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_get.md?pixel)]()

View File

@ -113,7 +113,6 @@ $ kubectl label pods foo bar-
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -121,7 +120,7 @@ $ kubectl label pods foo bar-
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-21 17:04:52.392784742 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-25 10:17:24.593929691 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_label.md?pixel)]()

View File

@ -92,7 +92,6 @@ $ kubectl logs -f 123456-7890 ruby-container
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -100,7 +99,7 @@ $ kubectl logs -f 123456-7890 ruby-container
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.476847461 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.165044878 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_logs.md?pixel)]()

View File

@ -78,7 +78,6 @@ kubectl namespace [namespace]
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -86,7 +85,7 @@ kubectl namespace [namespace]
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.476203071 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.164903046 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_namespace.md?pixel)]()

View File

@ -96,7 +96,6 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -104,7 +103,7 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.475848256 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.164613432 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_patch.md?pixel)]()

View File

@ -93,7 +93,6 @@ $ kubectl port-forward mypod 0:5000
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -101,7 +100,7 @@ $ kubectl port-forward mypod 0:5000
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.47778769 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.166148947 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_port-forward.md?pixel)]()

View File

@ -115,7 +115,6 @@ $ kubectl proxy --api-prefix=/k8s-api
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -123,7 +122,7 @@ $ kubectl proxy --api-prefix=/k8s-api
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.477994494 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.166284754 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_proxy.md?pixel)]()

View File

@ -76,6 +76,7 @@ kubectl replace --force -f ./pod.json
-h, --help[=false]: help for replace
-o, --output="": Output mode. Use "-o name" for shorter output (resource/name).
--timeout=0: Only relevant during a force replace. The length of time to wait before giving up on a delete of the old resource, zero means determine a timeout from the size of the object
--validate[=true]: If true, use a schema to validate the input before sending it
```
### Options inherited from parent commands
@ -103,7 +104,6 @@ kubectl replace --force -f ./pod.json
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -111,7 +111,7 @@ kubectl replace --force -f ./pod.json
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.475684757 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.164469074 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_replace.md?pixel)]()

View File

@ -84,6 +84,7 @@ $ kubectl rolling-update frontend --image=image:v2
--template="": Template string or path to template file to use when -o=template, -o=templatefile or -o=jsonpath. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. The jsonpath template is composed of jsonpath expressions enclosed by {} [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md]
--timeout=5m0s: Max time to wait for a replication controller to update before giving up. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
--update-period=1m0s: Time to wait between updating pods. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
--validate[=true]: If true, use a schema to validate the input before sending it
```
### Options inherited from parent commands
@ -111,7 +112,6 @@ $ kubectl rolling-update frontend --image=image:v2
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -119,7 +119,7 @@ $ kubectl rolling-update frontend --image=image:v2
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-21 17:04:52.390982319 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-25 10:17:24.592687096 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rolling-update.md?pixel)]()

View File

@ -120,7 +120,6 @@ $ kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -128,7 +127,7 @@ $ kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-21 17:04:52.392255386 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-25 10:17:24.593489492 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_run.md?pixel)]()

View File

@ -102,7 +102,6 @@ $ kubectl scale --replicas=5 rc/foo rc/bar
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -110,7 +109,7 @@ $ kubectl scale --replicas=5 rc/foo rc/bar
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.477281515 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.165785015 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_scale.md?pixel)]()

View File

@ -104,7 +104,6 @@ $ kubectl stop -f path/to/resources
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -112,7 +111,7 @@ $ kubectl stop -f path/to/resources
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.478408029 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.166601667 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_stop.md?pixel)]()

View File

@ -76,7 +76,6 @@ kubectl version
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--validate[=false]: If true, use a schema to validate the input before sending it
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```
@ -84,7 +83,7 @@ kubectl version
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.48136046 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-21 17:18:05.1688832 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_version.md?pixel)]()

View File

@ -1,7 +1,6 @@
{
"kind":"ReplicationController",
"apiVersion":"v1",
"id":"redis-master",
"metadata":{
"name":"redis-master",
"labels":{

View File

@ -141,7 +141,6 @@ func (s *SwaggerSchema) ValidateObject(obj interface{}, apiVersion, fieldName, t
}
errs := s.validateField(value, apiVersion, fieldName+key, fieldType, &details)
if len(errs) > 0 {
glog.Errorf("Validation failed for: %s, %v", key, value)
allErrs = append(allErrs, errs...)
}
}

View File

@ -155,7 +155,7 @@ func NewTestFactory() (*cmdutil.Factory, *testFactory, runtime.Codec) {
Printer: func(mapping *meta.RESTMapping, noHeaders, withNamespace bool, wide bool, showAll bool, columnLabels []string) (kubectl.ResourcePrinter, error) {
return t.Printer, t.Err
},
Validator: func() (validation.Schema, error) {
Validator: func(validate bool) (validation.Schema, error) {
return t.Validator, t.Err
},
DefaultNamespace: func() (string, bool, error) {
@ -210,7 +210,7 @@ func NewAPIFactory() (*cmdutil.Factory, *testFactory, runtime.Codec) {
Printer: func(mapping *meta.RESTMapping, noHeaders, withNamespace bool, wide bool, showAll bool, columnLabels []string) (kubectl.ResourcePrinter, error) {
return t.Printer, t.Err
},
Validator: func() (validation.Schema, error) {
Validator: func(validate bool) (validation.Schema, error) {
return t.Validator, t.Err
},
DefaultNamespace: func() (string, bool, error) {

View File

@ -57,7 +57,7 @@ func NewCmdCreate(f *cmdutil.Factory, out io.Writer) *cobra.Command {
usage := "Filename, directory, or URL to file to use to create the resource"
kubectl.AddJsonFilenameFlag(cmd, usage)
cmd.MarkFlagRequired("filename")
cmdutil.AddValidateFlag(cmd)
cmdutil.AddOutputFlagsForMutation(cmd)
return cmd
}
@ -70,8 +70,7 @@ func ValidateArgs(cmd *cobra.Command, args []string) error {
}
func RunCreate(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer) error {
schema, err := f.Validator()
schema, err := f.Validator(cmdutil.GetFlagBool(cmd, "validate"))
if err != nil {
return err
}

View File

@ -73,6 +73,7 @@ func NewCmdReplace(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd.Flags().Bool("cascade", false, "Only relevant during a force replace. If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController).")
cmd.Flags().Int("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.")
cmd.Flags().Duration("timeout", 0, "Only relevant during a force replace. The length of time to wait before giving up on a delete of the old resource, zero means determine a timeout from the size of the object")
cmdutil.AddValidateFlag(cmd)
cmdutil.AddOutputFlagsForMutation(cmd)
return cmd
}
@ -81,7 +82,7 @@ func RunReplace(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []st
if len(os.Args) > 1 && os.Args[1] == "update" {
printDeprecationWarning("replace", "update")
}
schema, err := f.Validator()
schema, err := f.Validator(cmdutil.GetFlagBool(cmd, "validate"))
if err != nil {
return err
}
@ -135,7 +136,7 @@ func RunReplace(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []st
}
func forceReplace(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, filenames []string, shortOutput bool) error {
schema, err := f.Validator()
schema, err := f.Validator(cmdutil.GetFlagBool(cmd, "validate"))
if err != nil {
return err
}

View File

@ -85,6 +85,7 @@ func NewCmdRollingUpdate(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd.Flags().String("deployment-label-key", "deployment", "The key to use to differentiate between two different controllers, default 'deployment'. Only relevant when --image is specified, ignored otherwise")
cmd.Flags().Bool("dry-run", false, "If true, print out the changes that would be made, but don't actually make them.")
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.AddValidateFlag(cmd)
cmdutil.AddPrinterFlags(cmd)
return cmd
}
@ -163,7 +164,7 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg
mapper, typer := f.Object()
if len(filename) != 0 {
schema, err := f.Validator()
schema, err := f.Validator(cmdutil.GetFlagBool(cmd, "validate"))
if err != nil {
return err
}

View File

@ -79,7 +79,7 @@ type Factory struct {
// LabelsForObject returns the labels associated with the provided object
LabelsForObject func(object runtime.Object) (map[string]string, error)
// Returns a schema that can validate objects stored on disk.
Validator func() (validation.Schema, error)
Validator func(validate bool) (validation.Schema, error)
// Returns the default namespace to use in cases where no
// other namespace is specified and whether the namespace was
// overriden.
@ -247,8 +247,8 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
}
return kubectl.ReaperFor(mapping.Kind, client, expClient)
},
Validator: func() (validation.Schema, error) {
if flags.Lookup("validate").Value.String() == "true" {
Validator: func(validate bool) (validation.Schema, error) {
if validate {
client, err := clients.ClientForVersion("")
if err != nil {
return nil, err
@ -273,12 +273,6 @@ func (f *Factory) BindFlags(flags *pflag.FlagSet) {
// any flags defined by external projects (not part of pflags)
flags.AddGoFlagSet(flag.CommandLine)
// Hack for global access to validation flag.
// TODO: Refactor out after configuration flag overhaul.
if f.flags.Lookup("validate") == nil {
f.flags.Bool("validate", false, "If true, use a schema to validate the input before sending it")
}
// Merge factory's flags
flags.AddFlagSet(f.flags)

View File

@ -259,6 +259,10 @@ func GetFlagDuration(cmd *cobra.Command, flag string) time.Duration {
return d
}
func AddValidateFlag(cmd *cobra.Command) {
cmd.Flags().Bool("validate", true, "If true, use a schema to validate the input before sending it")
}
func ReadConfigDataFromReader(reader io.Reader, source string) ([]byte, error) {
data, err := ioutil.ReadAll(reader)
if err != nil {

View File

@ -34,7 +34,10 @@ import (
"k8s.io/kubernetes/pkg/watch"
)
const constSTDINstr string = "STDIN"
const (
constSTDINstr string = "STDIN"
stopValidateMessage = "if you choose to ignore these errors, turn validation off with --validate=false"
)
// Visitor lets clients walk a list of resources.
type Visitor interface {
@ -205,7 +208,7 @@ func ValidateSchema(data []byte, schema validation.Schema) error {
return fmt.Errorf("error converting to YAML: %v", err)
}
if err := schema.ValidateBytes(data); err != nil {
return fmt.Errorf("error validating data: %v", err)
return fmt.Errorf("error validating data: %v; %s", err, stopValidateMessage)
}
return nil
}