Merge pull request #11184 from caesarxuchao/patch-replace-doc

Auto commit by PR queue bot
This commit is contained in:
Alex Mohr 2015-08-04 11:18:39 -07:00
commit 7eade1c2ce
6 changed files with 30 additions and 5 deletions

View File

@ -18,6 +18,10 @@ Update field(s) of a resource using strategic merge patch
.PP
JSON and YAML formats are accepted.
.PP
Please refer to the models in
\[la]https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html\[ra] to find if a field is mutable.
.SH OPTIONS
.PP
@ -140,6 +144,9 @@ JSON and YAML formats are accepted.
// Partially update a node using strategic merge patch
kubectl patch node k8s\-node\-1 \-p '{"spec":{"unschedulable":true}}'
// Update a container's image; spec.containers[*].name is required because it's a merge key
kubectl patch pod valid\-pod \-p '{"spec":{"containers":[{"name":"kubernetes\-serve\-hostname","image":"new image"}]}}'
.fi
.RE

View File

@ -18,6 +18,10 @@ Replace a resource by filename or stdin.
.PP
JSON and YAML formats are accepted.
.PP
Please refer to the models in
\[la]https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html\[ra] to find if a field is mutable.
.SH OPTIONS
.PP

View File

@ -42,6 +42,8 @@ Update field(s) of a resource using strategic merge patch
JSON and YAML formats are accepted.
Please refer to the models in https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html to find if a field is mutable.
```
kubectl patch RESOURCE NAME -p PATCH
```
@ -52,6 +54,9 @@ kubectl patch RESOURCE NAME -p PATCH
// Partially update a node using strategic merge patch
kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'
// Update a container's image; spec.containers[*].name is required because it's a merge key
kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}'
```
### Options
@ -95,7 +100,7 @@ kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-14 00:11:42.956026887 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-01 00:12:16.314479678 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->

View File

@ -42,6 +42,8 @@ Replace a resource by filename or stdin.
JSON and YAML formats are accepted.
Please refer to the models in https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html to find if a field is mutable.
```
kubectl replace -f FILENAME
```
@ -104,7 +106,7 @@ kubectl replace --force -f ./pod.json
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-07-16 22:39:16.132838722 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-01 00:12:16.314376117 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->

View File

@ -29,10 +29,15 @@ import (
const (
patch_long = `Update field(s) of a resource using strategic merge patch
JSON and YAML formats are accepted.`
JSON and YAML formats are accepted.
Please refer to the models in https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html to find if a field is mutable.`
patch_example = `
// Partially update a node using strategic merge patch
kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'`
kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'
// Update a container's image; spec.containers[*].name is required because it's a merge key
kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}'`
)
func NewCmdPatch(f *cmdutil.Factory, out io.Writer) *cobra.Command {

View File

@ -35,7 +35,9 @@ import (
const (
replace_long = `Replace a resource by filename or stdin.
JSON and YAML formats are accepted.`
JSON and YAML formats are accepted.
Please refer to the models in https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html to find if a field is mutable.`
replace_example = `// Replace a pod using the data in pod.json.
$ kubectl replace -f ./pod.json