Files
kubernetes/hack
Kubernetes Submit Queue c31893978b Merge pull request #45918 from juanvallejo/jvallejo/fix-kubectl-set-resources-local
Automatic merge from submit-queue

fix --local flag for kubectl commands

Fixes https://github.com/kubernetes/kubernetes/issues/47079

**Release note**:
```release-note
NONE
```

Fixes the `--local` flag for `kubectl set ...` sub-commands.
**As of the 1.7 release**, `PrinterForCommand` was updated to [use a mapper and typer for unstructured objects](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/util/factory_builder.go#L52), which further prevented the use of `--local` when there was no connection to an api server.


**before** (with no connection to a server)
```
$ kubectl set resources -f pod.json --limits=cpu=200m,memory=512Mi --local
error: unable to connect to a server to handle "pods": Get https://10.13.137.149:8443/api: dial tcp 10.13.137.149:8443: getsockopt: connection refused
```

**after** (with no connection to a server)
```
$ kubectl set resources -f pod.json --limits=cpu=200m,memory=512Mi --local
NAME              READY     STATUS    RESTARTS   AGE
mypod   0/1                 0          <unknown>
```

cc @smarterclayton @fabianofranz
2017-06-16 08:19:13 -07:00
..
2017-03-25 12:16:50 -07:00
2017-06-08 14:59:55 -07:00
2017-06-09 10:13:34 +08:00
2017-06-08 14:59:55 -07:00
2017-02-01 15:18:32 -05:00
2017-05-27 14:34:45 +08:00
2017-04-28 18:51:34 +00:00
2017-04-27 15:01:34 -07:00
2017-05-19 10:17:37 -06:00
2017-04-27 15:01:34 -07:00
2016-12-06 13:45:10 -05:00
2017-05-19 10:17:37 -06:00
2016-12-14 06:03:00 -08:00