direct people to api-reference/definitions.html to find out if a field is mutable through kubectl replace/patch

This commit is contained in:
Chao Xu
2015-07-13 13:46:51 -07:00
parent b280549930
commit 17cd3cf392
6 changed files with 30 additions and 5 deletions

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