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
63 lines
1.8 KiB
Python
63 lines
1.8 KiB
Python
package(default_visibility = ["//visibility:public"])
|
|
|
|
licenses(["notice"])
|
|
|
|
load(
|
|
"@io_bazel_rules_go//go:def.bzl",
|
|
"go_library",
|
|
"go_test",
|
|
)
|
|
|
|
go_library(
|
|
name = "go_default_library",
|
|
srcs = [
|
|
"auth_loaders.go",
|
|
"client_config.go",
|
|
"config.go",
|
|
"doc.go",
|
|
"helpers.go",
|
|
"loader.go",
|
|
"merged_client_builder.go",
|
|
"overrides.go",
|
|
"validation.go",
|
|
],
|
|
tags = ["automanaged"],
|
|
deps = [
|
|
"//pkg/api:go_default_library",
|
|
"//pkg/client/restclient:go_default_library",
|
|
"//pkg/client/unversioned/auth:go_default_library",
|
|
"//pkg/client/unversioned/clientcmd/api:go_default_library",
|
|
"//pkg/client/unversioned/clientcmd/api/latest:go_default_library",
|
|
"//pkg/runtime:go_default_library",
|
|
"//pkg/runtime/schema:go_default_library",
|
|
"//pkg/util/errors:go_default_library",
|
|
"//pkg/util/homedir:go_default_library",
|
|
"//pkg/util/validation:go_default_library",
|
|
"//vendor:github.com/golang/glog",
|
|
"//vendor:github.com/howeyc/gopass",
|
|
"//vendor:github.com/imdario/mergo",
|
|
"//vendor:github.com/spf13/pflag",
|
|
],
|
|
)
|
|
|
|
go_test(
|
|
name = "go_default_test",
|
|
srcs = [
|
|
"client_config_test.go",
|
|
"loader_test.go",
|
|
"merged_client_builder_test.go",
|
|
"validation_test.go",
|
|
],
|
|
library = "go_default_library",
|
|
tags = ["automanaged"],
|
|
deps = [
|
|
"//pkg/client/restclient:go_default_library",
|
|
"//pkg/client/unversioned/clientcmd/api:go_default_library",
|
|
"//pkg/client/unversioned/clientcmd/api/latest:go_default_library",
|
|
"//pkg/runtime:go_default_library",
|
|
"//pkg/util/errors:go_default_library",
|
|
"//vendor:github.com/ghodss/yaml",
|
|
"//vendor:github.com/imdario/mergo",
|
|
],
|
|
)
|