Files
kubernetes/pkg/kubectl
k8s-merge-robot 951b591716 Merge pull request #26722 from deads2k/local-patch
Automatic merge from submit-queue

let patch use --local flag like `kubectl set image`

Adds the concept of a `--local` flag to `kubectl patch`.  This flag is similar to `kubectl set image -f --local` because it will use the content of the file as the input to the patch operation instead of using the file content to file resource/name tuples.  

This pull lets you run something like `kubectl create deployment --dry-run -o yaml | kubectl set volume --local -f - -o yaml | kubectl patch --local -f - --patch {} | kubectl create -f -`

As proof that it works, you can run against a local file just to mess around with it, but `--local -f -` is the most likely case.
```
$kubectl patch --local -f pkg/api/validation/testdata/v1/validPod.yaml --patch='{"spec": {"restartPolicy":"Never"}}'
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    name: redis-master
  name: name
spec:
  containers:
  - args:
    - this
    - is
    - an
    - ok
    - command
    image: gcr.io/fake_project/fake_image:fake_tag
    name: master
    resources: {}
  restartPolicy: Never
status: {}
```

This is useful for setting rarely used, but immutable fields from `kubectl create` or `kubectl convert` without dropping to an interactive editor.

Some discussion here: https://github.com/kubernetes/kubernetes/issues/21648#issuecomment-218579977

@smarterclayton @kubernetes/kubectl 
 @eparis @soltysh @stevekuznetsov we've talked about this separately
2016-06-25 10:00:41 -07:00
..
2016-05-13 12:41:40 -07:00
2016-02-18 21:24:21 -05:00
2016-05-12 00:07:07 -04:00
2016-05-29 02:09:39 -07:00
2016-05-10 09:55:14 -07:00
2016-05-10 13:49:39 -07:00
2016-05-29 02:09:39 -07:00
2016-05-21 15:48:40 +02:00
2016-04-29 17:12:10 -04:00
2016-02-18 21:24:21 -05:00
2016-05-12 00:07:07 -04:00
2015-08-05 17:30:03 -07:00
2016-04-29 17:12:10 -04:00
2015-08-05 17:30:03 -07:00