-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add restclientconfig helper fn for parsing timeout #37708
Add restclientconfig helper fn for parsing timeout #37708
Conversation
Can a kubernetes member verify that this patch is reasonable to test? If so, please reply with "@k8s-bot ok to test" on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands will still work. Regular contributors should join the org to skip this step.
If you have questions or suggestions related to this bot's behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
|
@k8s-bot ok to test |
limitations under the License. | ||
*/ | ||
|
||
package util |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the need for an util
package. This can go directly in pkg/client/unversioned/clientcmd/helpers.go
.
if requestTimeout, err := time.ParseDuration(duration); err == nil { | ||
return requestTimeout, nil | ||
} | ||
return 0, fmt.Errorf("Invalid timeout value. Timeout must be a single integer, or an integer followed by a corresponding time unit (e.g. 1s | 2m | 3h)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this didn't change, but we could make it clear the unit when it's a single integer. Like "...must be a single integer in seconds, or an integer...".
@fabianofranz Thanks for the feedback, review comments addressed |
976f67c
to
e051bd9
Compare
Jenkins GCI GCE e2e failed for commit 976f67cada78fcf80118984b8da83be193fc7acb. Full PR test history. The magic incantation to run this job again is |
Squash then LGTM. |
e051bd9
to
0c975ce
Compare
Done! |
@k8s-bot unit test this |
0c975ce
to
22e1687
Compare
Jenkins unit/integration failed for commit 0c975ceaaf0c9c7673c28b33139117243cdfc8eb. Full PR test history. The magic incantation to run this job again is |
Jenkins verification failed for commit 22e16875cfd7166d97f9bd0c8c0a5be6019d05a9. Full PR test history. The magic incantation to run this job again is |
22e1687
to
c92e14a
Compare
Jenkins GCE etcd3 e2e failed for commit c92e14a19ff481237a67bf1cbed08a235e181ca4. Full PR test history. The magic incantation to run this job again is |
Jenkins GCE e2e failed for commit 22e16875cfd7166d97f9bd0c8c0a5be6019d05a9. Full PR test history. The magic incantation to run this job again is |
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).
c92e14a
to
885b7a6
Compare
Jenkins kops AWS e2e failed for commit 885b7a6. Full PR test history. The magic incantation to run this job again is |
@lavalamp or @fabianofranz would this patch be okay to tag? |
@k8s-bot kops aws e2e test this |
Automatic merge from submit-queue (batch tested with PRs 37708, 34410) |
Related downstream PR: openshift/origin#12062 (example of use-case for this patch)
Release note:
This patch adds a package
pkg/client/unversioned/clientcmd/util
anddefines a
ParseTimeout
helper function for parsing time from auser-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