From 5c75b02c3bd2f38541a95569ea4a2e157fdff184 Mon Sep 17 00:00:00 2001 From: Sneha Aradhey Date: Thu, 17 Aug 2023 00:05:30 +0000 Subject: [PATCH] Update dependency go modules for k8s v1.28.0 --- go.mod | 8 +++---- go.sum | 16 +++++++------- .../csi-lib-utils/connection/connection.go | 2 +- .../csi-lib-utils/metrics/metrics.go | 21 ------------------- .../protosanitizer/protosanitizer.go | 9 ++++---- vendor/golang.org/x/net/http2/transport.go | 5 ++++- vendor/modules.txt | 8 +++---- 7 files changed, 26 insertions(+), 43 deletions(-) diff --git a/go.mod b/go.mod index 7a1e3786..88573cf2 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/container-storage-interface/spec v1.8.0 github.com/golang/mock v1.6.0 - github.com/kubernetes-csi/csi-lib-utils v0.15.0-rc0 + github.com/kubernetes-csi/csi-lib-utils v0.14.0 github.com/kubernetes-csi/csi-test/v5 v5.0.0 google.golang.org/grpc v1.57.0 k8s.io/klog/v2 v2.100.1 @@ -23,11 +23,11 @@ require ( github.com/prometheus/common v0.44.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/net v0.12.0 // indirect + golang.org/x/net v0.13.0 // indirect golang.org/x/sys v0.10.0 // indirect golang.org/x/text v0.11.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect google.golang.org/protobuf v1.30.0 // indirect - k8s.io/apimachinery v0.28.0-rc.0 // indirect - k8s.io/component-base v0.28.0-rc.0 // indirect + k8s.io/apimachinery v0.28.0 // indirect + k8s.io/component-base v0.28.0 // indirect ) diff --git a/go.sum b/go.sum index 0aad9398..7dd3e6a4 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,8 @@ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/kubernetes-csi/csi-lib-utils v0.15.0-rc0 h1:dQt470GSUkg++Z3I/5iEchrD1rHADVADcgR837x+n08= -github.com/kubernetes-csi/csi-lib-utils v0.15.0-rc0/go.mod h1:9Ztr8GnZxmEAdo+YJlGigQ0ftzf2JdWG904YOxPGRfU= +github.com/kubernetes-csi/csi-lib-utils v0.14.0 h1:pusB32LkSd7GhuT8Z6cyRFqByujc28ygWV97ndaT19s= +github.com/kubernetes-csi/csi-lib-utils v0.14.0/go.mod h1:uX8xidqxGJOLXtsfCCVsxWtZl/9NiLyd2DD3Nb+KoP4= github.com/kubernetes-csi/csi-test/v5 v5.0.0 h1:GJ0M+ppcKgWhafXH3B2Ssfw1Egzly9GlMx3JOQApekM= github.com/kubernetes-csi/csi-test/v5 v5.0.0/go.mod h1:jVEIqf8Nv1roo/4zhl/r6Tc68MAgRX/OQSQK0azTHyo= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= @@ -142,8 +142,8 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY= +golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -246,10 +246,10 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/apimachinery v0.28.0-rc.0 h1:qh5r3Vk+HADGQx4zI99eZzXOCMutZj2/UlTKCY2/ePM= -k8s.io/apimachinery v0.28.0-rc.0/go.mod h1:xhQIsaL3hXneGluH+0pzF7kr+VYuLS/VcYJxF1xQf+g= -k8s.io/component-base v0.28.0-rc.0 h1:MFPluB1AXf6AzHs1qoBS1JJ1xAFeL0Ideb3QAMdk3s0= -k8s.io/component-base v0.28.0-rc.0/go.mod h1:I22ElTkO4PGZjhokvW89/x8thAZm6tI73juVAcrvErs= +k8s.io/apimachinery v0.28.0 h1:ScHS2AG16UlYWk63r46oU3D5y54T53cVI5mMJwwqFNA= +k8s.io/apimachinery v0.28.0/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw= +k8s.io/component-base v0.28.0 h1:HQKy1enJrOeJlTlN4a6dU09wtmXaUvThC0irImfqyxI= +k8s.io/component-base v0.28.0/go.mod h1:Yyf3+ZypLfMydVzuLBqJ5V7Kx6WwDr/5cN+dFjw1FNk= k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/connection/connection.go b/vendor/github.com/kubernetes-csi/csi-lib-utils/connection/connection.go index 41e8908f..cbdf7c34 100644 --- a/vendor/github.com/kubernetes-csi/csi-lib-utils/connection/connection.go +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/connection/connection.go @@ -193,7 +193,7 @@ func LogGRPC(ctx context.Context, method string, req, reply interface{}, cc *grp klog.V(5).Infof("GRPC call: %s", method) klog.V(5).Infof("GRPC request: %s", protosanitizer.StripSecrets(req)) err := invoker(ctx, method, req, reply, cc, opts...) - cappedStr := protosanitizer.StripSecrets(reply).String() + cappedStr := fmt.Sprintf("%s", protosanitizer.StripSecrets(reply)) if maxLogChar > 0 && len(cappedStr) > maxLogChar { cappedStr = cappedStr[:maxLogChar] + fmt.Sprintf(" [response body too large, log capped to %d chars]", maxLogChar) } diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/metrics/metrics.go b/vendor/github.com/kubernetes-csi/csi-lib-utils/metrics/metrics.go index 33b64c7c..b641fffc 100644 --- a/vendor/github.com/kubernetes-csi/csi-lib-utils/metrics/metrics.go +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/metrics/metrics.go @@ -20,7 +20,6 @@ import ( "bufio" "fmt" "net/http" - "net/http/pprof" "sort" "strings" "time" @@ -100,12 +99,6 @@ type CSIMetricsManager interface { // RegisterToServer registers an HTTP handler for this metrics manager to the // given server at the specified address/path. RegisterToServer(s Server, metricsPath string) - - // RegisterPprofToServer registers the HTTP handlers necessary to enable pprof - // for this metrics manager to the given server at the usual path. - // This function is not needed when using DefaultServeMux as the Server since - // the handlers will automatically be registered when importing pprof. - RegisterPprofToServer(s Server) } // Server represents any type that could serve HTTP requests for the metrics @@ -395,20 +388,6 @@ func (cmm *csiMetricsManager) RegisterToServer(s Server, metricsPath string) { ErrorHandling: metrics.ContinueOnError})) } -// RegisterPprofToServer registers the HTTP handlers necessary to enable pprof -// for this metrics manager to the given server at the usual path. -// This function is not needed when using DefaultServeMux as the Server since -// the handlers will automatically be registered when importing pprof. -func (cmm *csiMetricsManager) RegisterPprofToServer(s Server) { - // Needed handlers can be seen here: - // https://github.com/golang/go/blob/master/src/net/http/pprof/pprof.go#L27 - s.Handle("/debug/pprof/", http.HandlerFunc(pprof.Index)) - s.Handle("/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline)) - s.Handle("/debug/pprof/profile", http.HandlerFunc(pprof.Profile)) - s.Handle("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol)) - s.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace)) -} - // VerifyMetricsMatch is a helper function that verifies that the expected and // actual metrics are identical excluding metricToIgnore. // This method is only used by tests. Ideally it should be in the _test file, diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer.go b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer.go index cad31f17..af64a7b2 100644 --- a/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer.go +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer.go @@ -26,6 +26,7 @@ import ( "github.com/golang/protobuf/descriptor" "github.com/golang/protobuf/proto" + protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor" protobufdescriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" ) @@ -55,7 +56,7 @@ func StripSecretsCSI03(msg interface{}) fmt.Stringer { type stripSecrets struct { msg interface{} - isSecretField func(field *protobufdescriptor.FieldDescriptorProto) bool + isSecretField func(field *protobuf.FieldDescriptorProto) bool } func (s *stripSecrets) String() string { @@ -109,7 +110,7 @@ func (s *stripSecrets) strip(parsed interface{}, msg interface{}) { if _, ok := parsedFields[field.GetName()]; ok { parsedFields[field.GetName()] = "***stripped***" } - } else if field.GetType() == protobufdescriptor.FieldDescriptorProto_TYPE_MESSAGE { + } else if field.GetType() == protobuf.FieldDescriptorProto_TYPE_MESSAGE { // When we get here, // the type name is something like ".csi.v1.CapacityRange" (leading dot!) // and looking up "csi.v1.CapacityRange" @@ -149,7 +150,7 @@ func (s *stripSecrets) strip(parsed interface{}, msg interface{}) { // isCSI1Secret uses the csi.E_CsiSecret extension from CSI 1.0 to // determine whether a field contains secrets. -func isCSI1Secret(field *protobufdescriptor.FieldDescriptorProto) bool { +func isCSI1Secret(field *protobuf.FieldDescriptorProto) bool { ex, err := proto.GetExtension(field.Options, e_CsiSecret) return err == nil && ex != nil && *ex.(*bool) } @@ -171,6 +172,6 @@ var e_CsiSecret = &proto.ExtensionDesc{ // isCSI03Secret relies on the naming convention in CSI <= 0.3 // to determine whether a field contains secrets. -func isCSI03Secret(field *protobufdescriptor.FieldDescriptorProto) bool { +func isCSI03Secret(field *protobuf.FieldDescriptorProto) bool { return strings.HasSuffix(field.GetName(), "_secrets") } diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index b9632380..b20c7491 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -518,11 +518,14 @@ func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { func authorityAddr(scheme string, authority string) (addr string) { host, port, err := net.SplitHostPort(authority) if err != nil { // authority didn't have a port + host = authority + port = "" + } + if port == "" { // authority's port was empty port = "443" if scheme == "http" { port = "80" } - host = authority } if a, err := idna.ToASCII(host); err == nil { host = a diff --git a/vendor/modules.txt b/vendor/modules.txt index 8a9db64f..a512ebc4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -27,7 +27,7 @@ github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp github.com/golang/protobuf/ptypes/wrappers -# github.com/kubernetes-csi/csi-lib-utils v0.15.0-rc0 +# github.com/kubernetes-csi/csi-lib-utils v0.14.0 ## explicit; go 1.18 github.com/kubernetes-csi/csi-lib-utils/connection github.com/kubernetes-csi/csi-lib-utils/metrics @@ -61,7 +61,7 @@ github.com/prometheus/procfs/internal/util # github.com/spf13/pflag v1.0.5 ## explicit; go 1.12 github.com/spf13/pflag -# golang.org/x/net v0.12.0 +# golang.org/x/net v0.13.0 ## explicit; go 1.17 golang.org/x/net/http/httpguts golang.org/x/net/http2 @@ -171,12 +171,12 @@ google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/timestamppb google.golang.org/protobuf/types/known/wrapperspb -# k8s.io/apimachinery v0.28.0-rc.0 +# k8s.io/apimachinery v0.28.0 ## explicit; go 1.20 k8s.io/apimachinery/pkg/util/sets k8s.io/apimachinery/pkg/util/version k8s.io/apimachinery/pkg/version -# k8s.io/component-base v0.28.0-rc.0 +# k8s.io/component-base v0.28.0 ## explicit; go 1.20 k8s.io/component-base/metrics k8s.io/component-base/metrics/prometheusextension