diff --git a/go.mod b/go.mod index 1ea6f68b3..1472dc336 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f knative.dev/hack v0.0.0-20231016131700-2c938d4918da knative.dev/hack/schema v0.0.0-20231016131700-2c938d4918da - knative.dev/pkg v0.0.0-20231016131056-058f699b3d10 + knative.dev/pkg v0.0.0-20231016185203-283df0be0668 ) require ( diff --git a/go.sum b/go.sum index f604d394b..8bcb68f7c 100644 --- a/go.sum +++ b/go.sum @@ -682,8 +682,8 @@ knative.dev/hack v0.0.0-20231016131700-2c938d4918da h1:xy+fvuz2LDOMsZ5UwXRaMF70N knative.dev/hack v0.0.0-20231016131700-2c938d4918da/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= knative.dev/hack/schema v0.0.0-20231016131700-2c938d4918da h1:euBj0+2eY7BryoQe6aVg6R40dkbsGHULu6wjBsB3Vf8= knative.dev/hack/schema v0.0.0-20231016131700-2c938d4918da/go.mod h1:3pWwBLnTZSM9psSgCAvhKOHIPTzqfEMlWRpDu6IYhK0= -knative.dev/pkg v0.0.0-20231016131056-058f699b3d10 h1:+kam6UYp2ESUkJBTqVO/H69bEWjuP62ts6O4QoC8O4Q= -knative.dev/pkg v0.0.0-20231016131056-058f699b3d10/go.mod h1:khuxKBM4WqjcCIeCIm+4VDNBmzMsl0ZspXGMm5i/fFA= +knative.dev/pkg v0.0.0-20231016185203-283df0be0668 h1:rYlTKNUZbMsSHQID0A7sZbrtXlD+REKN6F94ceMnA5c= +knative.dev/pkg v0.0.0-20231016185203-283df0be0668/go.mod h1:khuxKBM4WqjcCIeCIm+4VDNBmzMsl0ZspXGMm5i/fFA= 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= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/vendor/knative.dev/pkg/environment/client_config.go b/vendor/knative.dev/pkg/environment/client_config.go index 0b51857aa..aef33927e 100644 --- a/vendor/knative.dev/pkg/environment/client_config.go +++ b/vendor/knative.dev/pkg/environment/client_config.go @@ -44,12 +44,8 @@ func (c *ClientConfig) InitFlags(fs *flag.FlagSet) { fs.StringVar(&c.ServerURL, "server", "", "The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.") - if f := fs.Lookup("kubeconfig"); f != nil { - c.Kubeconfig = f.Value.String() - } else { - fs.StringVar(&c.Kubeconfig, "kubeconfig", os.Getenv("KUBECONFIG"), - "Path to a kubeconfig. Only required if out-of-cluster.") - } + fs.StringVar(&c.Kubeconfig, "kubeconfig", os.Getenv("KUBECONFIG"), + "Path to a kubeconfig. Only required if out-of-cluster.") fs.IntVar(&c.Burst, "kube-api-burst", int(envVarOrDefault("KUBE_API_BURST", 0)), "Maximum burst for throttle.") diff --git a/vendor/knative.dev/pkg/network/h2c.go b/vendor/knative.dev/pkg/network/h2c.go index ebf1ee8a2..e1671233d 100644 --- a/vendor/knative.dev/pkg/network/h2c.go +++ b/vendor/knative.dev/pkg/network/h2c.go @@ -59,13 +59,11 @@ func newH2CTransport(disableCompression bool) http.RoundTripper { // newH2Transport constructs a neew H2 transport. That transport will handles HTTPS traffic // with TLS config. -func newH2Transport(disableCompression bool, tlsConf *tls.Config) http.RoundTripper { +func newH2Transport(disableCompression bool, tlsContext DialTLSContextFunc) http.RoundTripper { return &http2.Transport{ DisableCompression: disableCompression, - DialTLS: func(netw, addr string, tlsConf *tls.Config) (net.Conn, error) { - return DialTLSWithBackOff(context.Background(), - netw, addr, tlsConf) + DialTLSContext: func(ctx context.Context, network, addr string, cfg *tls.Config) (net.Conn, error) { + return tlsContext(ctx, network, addr) }, - TLSClientConfig: tlsConf, } } diff --git a/vendor/knative.dev/pkg/network/transports.go b/vendor/knative.dev/pkg/network/transports.go index d48cd6215..1e9c6c219 100644 --- a/vendor/knative.dev/pkg/network/transports.go +++ b/vendor/knative.dev/pkg/network/transports.go @@ -127,16 +127,17 @@ func newHTTPTransport(disableKeepAlives, disableCompression bool, maxIdle, maxId return transport } -func newHTTPSTransport(disableKeepAlives, disableCompression bool, maxIdle, maxIdlePerHost int, tlsConf *tls.Config) http.RoundTripper { +type DialTLSContextFunc func(ctx context.Context, network, addr string) (net.Conn, error) + +func newHTTPSTransport(disableKeepAlives, disableCompression bool, maxIdle, maxIdlePerHost int, tlsContext DialTLSContextFunc) http.RoundTripper { transport := http.DefaultTransport.(*http.Transport).Clone() - transport.DialContext = DialWithBackOff transport.DisableKeepAlives = disableKeepAlives transport.MaxIdleConns = maxIdle transport.MaxIdleConnsPerHost = maxIdlePerHost transport.ForceAttemptHTTP2 = false transport.DisableCompression = disableCompression + transport.DialTLSContext = tlsContext - transport.TLSClientConfig = tlsConf return transport } @@ -148,11 +149,11 @@ func NewProberTransport() http.RoundTripper { NewH2CTransport()) } -// NewProxyAutoTLSTransport is same with NewProxyAutoTransport but it has tls.Config to create HTTPS request. -func NewProxyAutoTLSTransport(maxIdle, maxIdlePerHost int, tlsConf *tls.Config) http.RoundTripper { +// NewProxyAutoTLSTransport is same with NewProxyAutoTransport but it has DialTLSContextFunc to create HTTPS request. +func NewProxyAutoTLSTransport(maxIdle, maxIdlePerHost int, tlsContext DialTLSContextFunc) http.RoundTripper { return newAutoTransport( - newHTTPSTransport(false /*disable keep-alives*/, true /*disable auto-compression*/, maxIdle, maxIdlePerHost, tlsConf), - newH2Transport(true /*disable auto-compression*/, tlsConf)) + newHTTPSTransport(false /*disable keep-alives*/, true /*disable auto-compression*/, maxIdle, maxIdlePerHost, tlsContext), + newH2Transport(true /*disable auto-compression*/, tlsContext)) } // NewAutoTransport creates a RoundTripper that can use appropriate transport diff --git a/vendor/modules.txt b/vendor/modules.txt index 5407c99e9..5ac3f9b5f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -839,7 +839,7 @@ knative.dev/hack/schema/commands knative.dev/hack/schema/docs knative.dev/hack/schema/registry knative.dev/hack/schema/schema -# knative.dev/pkg v0.0.0-20231016131056-058f699b3d10 +# knative.dev/pkg v0.0.0-20231016185203-283df0be0668 ## explicit; go 1.18 knative.dev/pkg/apis knative.dev/pkg/apis/duck