mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 11:42:14 +00:00
Merge pull request #37708 from juanvallejo/jvallejo/add-restclient-config-helper-for-parsing-global-timeout
Automatic merge from submit-queue (batch tested with PRs 37708, 34410) Add restclientconfig helper fn for parsing timeout Related downstream PR: https://github.com/openshift/origin/pull/12062 (example of use-case for this patch) **Release note**: ```release-note release-note-none ``` This patch adds a package `pkg/client/unversioned/clientcmd/util` and defines a `ParseTimeout` helper function for parsing time from a user-defined string. This allows code re-use in other packages that require the creation of a new restclient (and therefore must set the `--global-timeout` flag value manually). @fabianofranz @kubernetes/cli-review
This commit is contained in:
@@ -1294,7 +1294,7 @@ __EOF__
|
||||
|
||||
## check --request-timeout value with invalid time unit
|
||||
output_message=$(! kubectl get pod valid-pod --request-timeout="1p" 2>&1)
|
||||
kube::test::if_has_string "${output_message}" 'Invalid value for option'
|
||||
kube::test::if_has_string "${output_message}" 'Invalid timeout value'
|
||||
|
||||
# cleanup
|
||||
kubectl delete pods valid-pod "${kube_flags[@]}"
|
||||
|
Reference in New Issue
Block a user