kubernetes/pkg/client
Kubernetes Submit Queue c0bd6e8ea5 Merge pull request #33958 from juanvallejo/jvallejo/add-global-timeout-flag
Automatic merge from submit-queue

Add global timeout flag

**Release note**:
```release-note
Add a new global option "--request-timeout" to the `kubectl` client
```

UPSTREAM: https://github.com/kubernetes/client-go/pull/10

This patch adds a global timeout flag (viewable with `kubectl -h`) with
a default value of `0s` (meaning no timeout).

The timeout value is added to the default http client, so that zero
values and default behavior are enforced by the client.

Adding a global timeout ensures that user-made scripts won't hang for an
indefinite amount of time while performing remote calls (right now, remote
calls are re-tried up to 10 times when each attempt fails, however, there is
no option to set a timeout in order to prevent any of these 10 attempts from
hanging indefinitely).

**Example**
```
$ kubectl get pods # no timeout flag set - default to 0s (which means no
timeout)
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$ kubectl get pods --request-timeout=0 # zero means no timeout no timeout flag set
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$kubectl get pods --request-timeout=1ms
Unable to connect to the server: net/http: request canceled while
waiting for connection (Client.Timeout exceeded while awaiting headers)
```
2016-10-14 23:29:58 -07:00
..
cache add rbac shared informers 2016-10-13 07:50:02 -04:00
chaosclient Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
clientset_generated generated 2016-10-04 20:39:29 -07:00
leaderelection Abstraction of endpoints in leaderelection code 2016-09-29 23:42:00 -05:00
metrics Remove implicit Prometheus metrics from client 2016-08-19 10:11:45 -07:00
record Merge pull request #29230 from luxas/goimport 2016-08-05 16:22:01 -07:00
restclient Add global timeout flag 2016-10-14 09:57:40 -04:00
testdata Added test cases for NewKubeletClient with TLS enabled 2014-12-18 00:57:33 -08:00
testing manual changes to let client-gen use versioned options 2016-10-04 20:39:29 -07:00
transport Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
typed Merge pull request #33234 from caesarxuchao/retry-discovery-failure 2016-10-07 05:13:21 -07:00
unversioned Add global timeout flag 2016-10-14 09:57:40 -04:00
OWNERS Move blunderbuss assignees into tree 2016-03-02 20:46:32 -05:00