mirror of https://github.com/knative/caching.git
upgrade to latest dependencies (#503)
bumping knative.dev/pkg 7764284...842df75: > 842df75 Update community files (# 2196) > fa8095f Use default Kubeconfig loading rules (# 2197) > d9b7180 minor bug when passing spoof options (# 2194) > 8931f82 remove source stats reporter (# 2193) > 591cb89 drop unused workflow (# 2192) > dbcf4cf removing default for KUBECONFIG to enable in cluster tests (# 2191) Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
parent
5976772c36
commit
b6b4e59cc4
2
go.mod
2
go.mod
|
@ -19,5 +19,5 @@ require (
|
|||
k8s.io/code-generator v0.20.7
|
||||
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd
|
||||
knative.dev/hack v0.0.0-20210622141627-e28525d8d260
|
||||
knative.dev/pkg v0.0.0-20210714200831-7764284cfa9a
|
||||
knative.dev/pkg v0.0.0-20210722223844-842df75f5c02
|
||||
)
|
||||
|
|
4
go.sum
4
go.sum
|
@ -1057,8 +1057,8 @@ k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g
|
|||
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
knative.dev/hack v0.0.0-20210622141627-e28525d8d260 h1:f2eMtOubAOc/Q7JlvFPDKXiPlJVK+VpX2Cot8hRzCgQ=
|
||||
knative.dev/hack v0.0.0-20210622141627-e28525d8d260/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
|
||||
knative.dev/pkg v0.0.0-20210714200831-7764284cfa9a h1:0VIHwoE4FmcLIcXQeawjzULqYq+Qy0IJgezg/TdDAYo=
|
||||
knative.dev/pkg v0.0.0-20210714200831-7764284cfa9a/go.mod h1:NYZRIPU+Pv39VfbZV1BtMIe4kCavNle1udsPrvOLm+Y=
|
||||
knative.dev/pkg v0.0.0-20210722223844-842df75f5c02 h1:I5G5tZx44cp6jCbZr2XLbuR5yWY8xV7nTxVTRDCT+Ug=
|
||||
knative.dev/pkg v0.0.0-20210722223844-842df75f5c02/go.mod h1:NYZRIPU+Pv39VfbZV1BtMIe4kCavNle1udsPrvOLm+Y=
|
||||
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
|
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
|||
package environment
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"math"
|
||||
|
@ -59,27 +58,12 @@ func (c *ClientConfig) GetRESTConfig() (*rest.Config, error) {
|
|||
return nil, fmt.Errorf("provided QPS value %f must be >0 and <3.4+e38", c.QPS)
|
||||
}
|
||||
|
||||
// If we have an explicit indication of where the kubernetes config lives, read that.
|
||||
if c.Kubeconfig != "" {
|
||||
return c.configFromPath(c.Kubeconfig)
|
||||
}
|
||||
|
||||
// If not, try the in-cluster config.
|
||||
if rc, err := rest.InClusterConfig(); err == nil {
|
||||
return c.applyOverrides(rc), nil
|
||||
}
|
||||
|
||||
// If no in-cluster config, try the default location in the user's home directory.
|
||||
if c, err := c.configFromPath(clientcmd.RecommendedHomeFile); err == nil {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
return nil, errors.New("could not create a valid kubeconfig")
|
||||
}
|
||||
|
||||
func (c *ClientConfig) configFromPath(path string) (*rest.Config, error) {
|
||||
loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()
|
||||
overrides := &clientcmd.ConfigOverrides{}
|
||||
|
||||
if c.Kubeconfig != "" {
|
||||
loadingRules.ExplicitPath = c.Kubeconfig
|
||||
}
|
||||
if c.Cluster != "" {
|
||||
overrides.Context = clientcmdapi.Context{Cluster: c.Cluster}
|
||||
} else if c.ServerURL != "" {
|
||||
|
@ -87,19 +71,16 @@ func (c *ClientConfig) configFromPath(path string) (*rest.Config, error) {
|
|||
}
|
||||
|
||||
config, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
|
||||
&clientcmd.ClientConfigLoadingRules{ExplicitPath: path},
|
||||
loadingRules,
|
||||
overrides,
|
||||
).ClientConfig()
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("failed to create client config: %w", err)
|
||||
}
|
||||
|
||||
return c.applyOverrides(config), nil
|
||||
}
|
||||
config.QPS = float32(c.QPS)
|
||||
config.Burst = c.Burst
|
||||
|
||||
func (c *ClientConfig) applyOverrides(restCfg *rest.Config) *rest.Config {
|
||||
restCfg.QPS = float32(c.QPS)
|
||||
restCfg.Burst = c.Burst
|
||||
return restCfg
|
||||
return config, nil
|
||||
}
|
||||
|
|
|
@ -578,7 +578,7 @@ k8s.io/utils/trace
|
|||
# knative.dev/hack v0.0.0-20210622141627-e28525d8d260
|
||||
## explicit
|
||||
knative.dev/hack
|
||||
# knative.dev/pkg v0.0.0-20210714200831-7764284cfa9a
|
||||
# knative.dev/pkg v0.0.0-20210722223844-842df75f5c02
|
||||
## explicit
|
||||
knative.dev/pkg/apis
|
||||
knative.dev/pkg/apis/duck
|
||||
|
|
Loading…
Reference in New Issue