diff --git a/go.mod b/go.mod index 97b011f07c67..063a1e848682 100644 --- a/go.mod +++ b/go.mod @@ -32,10 +32,10 @@ require ( k8s.io/code-generator v0.27.6 k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f k8s.io/utils v0.0.0-20230209194617-a36077c30491 - knative.dev/caching v0.0.0-20231012110827-8551914fdf65 - knative.dev/hack v0.0.0-20231010131532-fc76874b28c6 - knative.dev/networking v0.0.0-20231012062439-c0863403c83b - knative.dev/pkg v0.0.0-20231016092905-cf06733aa47b + knative.dev/caching v0.0.0-20231016135103-31d2498c86b9 + knative.dev/hack v0.0.0-20231016131700-2c938d4918da + knative.dev/networking v0.0.0-20231016141047-64434a8361bf + knative.dev/pkg v0.0.0-20231016185203-283df0be0668 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index 35255db2854d..3f471fa27b15 100644 --- a/go.sum +++ b/go.sum @@ -925,14 +925,14 @@ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5F k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/caching v0.0.0-20231012110827-8551914fdf65 h1:Uc8C/3ymQGO/JDLwiWojhfxmKvj0UjlywKDJF/mjq1o= -knative.dev/caching v0.0.0-20231012110827-8551914fdf65/go.mod h1:93dIqn2QXQP179R+gZKUFF7RaZFxJcL6ioXR04imKy0= -knative.dev/hack v0.0.0-20231010131532-fc76874b28c6 h1:K9saPnpWTK1xH/Dpx1aE4CA+4GR7AXSxQthwLXEf+zM= -knative.dev/hack v0.0.0-20231010131532-fc76874b28c6/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= -knative.dev/networking v0.0.0-20231012062439-c0863403c83b h1:yGtVPNHek3rmKb50k7G9fG/NuuC4FRzESVrWmPFU9AM= -knative.dev/networking v0.0.0-20231012062439-c0863403c83b/go.mod h1:uEvP4spV82HGB8loxo8nH/LGmwsd9jUGWvDVC+tH4O4= -knative.dev/pkg v0.0.0-20231016092905-cf06733aa47b h1:ELB4gahWrQ+C1flcudcX3v7ThYYOD3Tnm8+ISod2bwQ= -knative.dev/pkg v0.0.0-20231016092905-cf06733aa47b/go.mod h1:khuxKBM4WqjcCIeCIm+4VDNBmzMsl0ZspXGMm5i/fFA= +knative.dev/caching v0.0.0-20231016135103-31d2498c86b9 h1:SFtF0wwVIsI9xzaLmiyoH1nGX0TZcqK3k9Ox6FG/srw= +knative.dev/caching v0.0.0-20231016135103-31d2498c86b9/go.mod h1:3ga3lgl5HGzt71WWpcRLGLXwiky13qQpSlwzGyb/1J4= +knative.dev/hack v0.0.0-20231016131700-2c938d4918da h1:xy+fvuz2LDOMsZ5UwXRaMF70NYUs9fsG+EF5/ierYBg= +knative.dev/hack v0.0.0-20231016131700-2c938d4918da/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= +knative.dev/networking v0.0.0-20231016141047-64434a8361bf h1:XQ+IK+AzR/EKy/cV1NNtIEDakGfazDbIwvjs/6BunjI= +knative.dev/networking v0.0.0-20231016141047-64434a8361bf/go.mod h1:ygI25+T2udHcTEt5iobFtwqNcS1mNp4ziZYLuA4E6RI= +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= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= 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= diff --git a/vendor/knative.dev/pkg/apiextensions/storageversion/migrator.go b/vendor/knative.dev/pkg/apiextensions/storageversion/migrator.go index 7ac1cc932687..469031251e52 100644 --- a/vendor/knative.dev/pkg/apiextensions/storageversion/migrator.go +++ b/vendor/knative.dev/pkg/apiextensions/storageversion/migrator.go @@ -68,6 +68,11 @@ func (m *Migrator) Migrate(ctx context.Context, gr schema.GroupResource) error { return fmt.Errorf("unable to determine storage version for %s", gr) } + // don't migrate storage version if CRD has a single valid storage in its status + if len(crd.Status.StoredVersions) == 1 && crd.Status.StoredVersions[0] == version { + return nil + } + if err := m.migrateResources(ctx, gr.WithVersion(version)); err != nil { return err } diff --git a/vendor/knative.dev/pkg/environment/client_config.go b/vendor/knative.dev/pkg/environment/client_config.go index 0b51857aa143..aef33927ef72 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 ebf1ee8a2ac4..e1671233dcbd 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 d48cd62151ef..1e9c6c219865 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/knative.dev/pkg/test/upgrade/shell/executor.go b/vendor/knative.dev/pkg/test/upgrade/shell/executor.go index d41ccc765a77..020f0d3eddf5 100644 --- a/vendor/knative.dev/pkg/test/upgrade/shell/executor.go +++ b/vendor/knative.dev/pkg/test/upgrade/shell/executor.go @@ -185,7 +185,9 @@ func (w testingWriter) Write(p []byte) (n int, err error) { // Strip trailing newline because t.Log always adds one. p = bytes.TrimRight(p, "\n") - w.t.Logf("%s", p) + for _, line := range strings.Split(string(p), "\n") { + w.t.Logf(line) + } return n, nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index cd51dc17c40d..77d66071436e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1277,7 +1277,7 @@ k8s.io/utils/net k8s.io/utils/pointer k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/caching v0.0.0-20231012110827-8551914fdf65 +# knative.dev/caching v0.0.0-20231016135103-31d2498c86b9 ## explicit; go 1.18 knative.dev/caching/config knative.dev/caching/pkg/apis/caching @@ -1298,10 +1298,10 @@ knative.dev/caching/pkg/client/injection/informers/caching/v1alpha1/image/fake knative.dev/caching/pkg/client/injection/informers/factory knative.dev/caching/pkg/client/injection/informers/factory/fake knative.dev/caching/pkg/client/listers/caching/v1alpha1 -# knative.dev/hack v0.0.0-20231010131532-fc76874b28c6 +# knative.dev/hack v0.0.0-20231016131700-2c938d4918da ## explicit; go 1.18 knative.dev/hack -# knative.dev/networking v0.0.0-20231012062439-c0863403c83b +# knative.dev/networking v0.0.0-20231016141047-64434a8361bf ## explicit; go 1.18 knative.dev/networking/config knative.dev/networking/pkg @@ -1340,7 +1340,7 @@ knative.dev/networking/pkg/http/stats knative.dev/networking/pkg/ingress knative.dev/networking/pkg/k8s knative.dev/networking/pkg/prober -# knative.dev/pkg v0.0.0-20231016092905-cf06733aa47b +# knative.dev/pkg v0.0.0-20231016185203-283df0be0668 ## explicit; go 1.18 knative.dev/pkg/apiextensions/storageversion knative.dev/pkg/apiextensions/storageversion/cmd/migrate