Files
kubernetes/hack
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-14 23:19:18 -07:00
2016-06-08 17:22:12 -07:00
2016-05-12 22:04:19 -04:00
2016-03-02 20:46:32 -05:00
2016-06-08 17:22:12 -07:00
2016-05-08 20:30:37 -07:00
2016-06-08 17:22:12 -07:00
2016-04-20 12:12:29 -04:00
2016-06-08 17:22:12 -07:00
2016-05-26 10:27:45 -07:00
2016-06-08 17:22:12 -07:00