add "--force" flag to "kubectl update";

update relevant tests
This commit is contained in:
Chao Xu
2015-06-24 17:33:46 -07:00
parent ba10e3bf15
commit ef5de91fd7
9 changed files with 208 additions and 17 deletions

View File

@@ -43,7 +43,7 @@ $ kubectl delete pods --all
```
--all=false: [-all] to select all the specified resources.
--cascade=true: If true, cascade the delete resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.
--cascade=true: If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.
-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.
-h, --help=false: help for delete
@@ -84,6 +84,6 @@ $ kubectl delete pods --all
### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-06-03 18:21:01.053120485 +0000 UTC
###### Auto generated by spf13/cobra at 2015-06-26 00:15:55.835198432 +0000 UTC
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/kubectl_delete.md?pixel)]()

View File

@@ -24,14 +24,21 @@ $ cat pod.json | kubectl update -f -
// Partially update a node using strategic merge patch
kubectl --api-version=v1 update node k8s-node-1 --patch='{"spec":{"unschedulable":true}}'
// Force update, delete and then re-create the resource
kubectl update --force -f pod.json
```
### Options
```
--cascade=false: Only relevant during a force update. If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.
-f, --filename=[]: Filename, directory, or URL to file to use to update the resource.
--force=false: Delete and re-create the specified resource
--grace-period=-1: Only relevant during a force update. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative.
-h, --help=false: help for update
--patch="": A JSON document to override the existing resource. The resource is downloaded, patched with the JSON, then updated.
--timeout=0: Only relevant during a force update. 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
```
### Options inherited from parent commands
@@ -66,6 +73,6 @@ kubectl --api-version=v1 update node k8s-node-1 --patch='{"spec":{"unschedulable
### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-06-18 19:03:00.935576604 +0000 UTC
###### Auto generated by spf13/cobra at 2015-06-26 00:15:55.835055081 +0000 UTC
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/kubectl_update.md?pixel)]()

View File

@@ -35,7 +35,7 @@ will be lost along with the rest of the resource.
.PP
\fB\-\-cascade\fP=true
If true, cascade the delete resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.
If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.
.PP
\fB\-f\fP, \fB\-\-filename\fP=[]

View File

@@ -20,10 +20,22 @@ JSON and YAML formats are accepted.
.SH OPTIONS
.PP
\fB\-\-cascade\fP=false
Only relevant during a force update. If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.
.PP
\fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to file to use to update the resource.
.PP
\fB\-\-force\fP=false
Delete and re\-create the specified resource
.PP
\fB\-\-grace\-period\fP=\-1
Only relevant during a force update. Period of time in seconds given to the old resource to terminate gracefully. Ignored if negative.
.PP
\fB\-h\fP, \fB\-\-help\fP=false
help for update
@@ -32,6 +44,10 @@ JSON and YAML formats are accepted.
\fB\-\-patch\fP=""
A JSON document to override the existing resource. The resource is downloaded, patched with the JSON, then updated.
.PP
\fB\-\-timeout\fP=0
Only relevant during a force update. 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
.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
@@ -145,6 +161,9 @@ $ cat pod.json | kubectl update \-f \-
// Partially update a node using strategic merge patch
kubectl \-\-api\-version=v1 update node k8s\-node\-1 \-\-patch='\{"spec":\{"unschedulable":true\}\}'
// Force update, delete and then re\-create the resource
kubectl update \-\-force \-f pod.json
.fi
.RE