From 753067a40093ea7742925119f916dbfc65ae99af Mon Sep 17 00:00:00 2001 From: Sneha Aradhey Date: Thu, 17 Aug 2023 00:05:28 +0000 Subject: [PATCH 1/2] Squashed 'release-tools/' changes from 1df23db..de2fba8 de2fba8 Merge pull request #233 from andyzhangx/andyzhangx-patch-1 cee895e remove windows 20H2 build since it's EOL long time ago 670bb0e Merge pull request #229 from marosset/fix-codespell-errors 35d5e78 Merge pull request #219 from yashsingh74/update-registry 63473cc Merge pull request #231 from coulof/bump-go-version-1.20.5 29a5c76 Merge pull request #228 from mowangdk/chore/adopt_kubernetes_recommand_labels 8dd2821 Update cloudbuild image with go 1.20.5 2b8b80e fixing some codespell errors 72984ec chore: adopt kubernetes recommand label 901bcb5 Update registry k8s.gcr.io -> registry.k8s.io git-subtree-dir: release-tools git-subtree-split: de2fba88becec7dec6744355a8ddb0057c5fe2f9 --- SIDECAR_RELEASE_PROCESS.md | 2 +- cloudbuild.yaml | 4 ++-- contrib/get_supported_version_csi-sidecar.py | 4 ++-- prow.sh | 13 ++++++++++--- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/SIDECAR_RELEASE_PROCESS.md b/SIDECAR_RELEASE_PROCESS.md index d1cc80b8..0e3d516a 100644 --- a/SIDECAR_RELEASE_PROCESS.md +++ b/SIDECAR_RELEASE_PROCESS.md @@ -102,7 +102,7 @@ naming convention `-on-`. 1. If release was a new major/minor version, create a new `release-` branch at that commit. 1. Check [image build status](https://k8s-testgrid.appspot.com/sig-storage-image-build). -1. Promote images from k8s-staging-sig-storage to k8s.gcr.io/sig-storage. From +1. Promote images from k8s-staging-sig-storage to registry.k8s.io/sig-storage. From the [k8s image repo](https://github.com/kubernetes/k8s.io/tree/HEAD/registry.k8s.io/images/k8s-staging-sig-storage), run `./generate.sh > images.yaml`, and send a PR with the updated images. diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 6b76a9ed..99044b81 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -13,7 +13,7 @@ # See https://github.com/kubernetes/test-infra/blob/HEAD/config/jobs/image-pushing/README.md # for more details on image pushing process in Kubernetes. # -# To promote release images, see https://github.com/kubernetes/k8s.io/tree/HEAD/k8s.gcr.io/images/k8s-staging-sig-storage. +# To promote release images, see https://github.com/kubernetes/k8s.io/tree/HEAD/registry.k8s.io/images/k8s-staging-sig-storage. # This must be specified in seconds. If omitted, defaults to 600s (10 mins). # Building three images in external-snapshotter takes more than an hour. @@ -26,7 +26,7 @@ steps: # The image must contain bash and curl. Ideally it should also contain # the desired version of Go (currently defined in release-tools/prow.sh), # but that just speeds up the build and is not required. - - name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20230424-910a2a439d' + - name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20230623-56e06d7c18' entrypoint: ./.cloudbuild.sh env: - GIT_TAG=${_GIT_TAG} diff --git a/contrib/get_supported_version_csi-sidecar.py b/contrib/get_supported_version_csi-sidecar.py index b5380ab9..30bbcf24 100644 --- a/contrib/get_supported_version_csi-sidecar.py +++ b/contrib/get_supported_version_csi-sidecar.py @@ -32,7 +32,7 @@ def check_gh_command(): def duration_ago(dt): """ - Humanize duration ouputs + Humanize duration outputs """ delta = relativedelta(datetime.datetime.now(), dt) if delta.years > 0: @@ -98,7 +98,7 @@ def end_of_life_grouped_versions(versions): def get_release_docker_image(repo, version): """ - Extract docker image name from the relase page documentation + Extract docker image name from the release page documentation """ output = subprocess.check_output(['gh', 'release', '-R', repo, 'view', version], text=True) #Extract matching image name excluding ` diff --git a/prow.sh b/prow.sh index 1ae3ec97..7ec8a3f8 100755 --- a/prow.sh +++ b/prow.sh @@ -78,7 +78,7 @@ version_to_git () { # the list of windows versions was matched from: # - https://hub.docker.com/_/microsoft-windows-nanoserver # - https://hub.docker.com/_/microsoft-windows-servercore -configvar CSI_PROW_BUILD_PLATFORMS "linux amd64 amd64; linux ppc64le ppc64le -ppc64le; linux s390x s390x -s390x; linux arm arm -arm; linux arm64 arm64 -arm64; linux arm arm/v7 -armv7; windows amd64 amd64 .exe nanoserver:1809 servercore:ltsc2019; windows amd64 amd64 .exe nanoserver:20H2 servercore:20H2; windows amd64 amd64 .exe nanoserver:ltsc2022 servercore:ltsc2022" "Go target platforms (= GOOS + GOARCH) and file suffix of the resulting binaries" +configvar CSI_PROW_BUILD_PLATFORMS "linux amd64 amd64; linux ppc64le ppc64le -ppc64le; linux s390x s390x -s390x; linux arm arm -arm; linux arm64 arm64 -arm64; linux arm arm/v7 -armv7; windows amd64 amd64 .exe nanoserver:1809 servercore:ltsc2019; windows amd64 amd64 .exe nanoserver:ltsc2022 servercore:ltsc2022" "Go target platforms (= GOOS + GOARCH) and file suffix of the resulting binaries" # If we have a vendor directory, then use it. We must be careful to only # use this for "make" invocations inside the project's repo itself because @@ -875,10 +875,17 @@ install_snapshot_controller() { cnt=0 expected_running_pods=$(kubectl apply --dry-run=client -o "jsonpath={.spec.replicas}" -f "$SNAPSHOT_CONTROLLER_YAML") expected_namespace=$(kubectl apply --dry-run=client -o "jsonpath={.metadata.namespace}" -f "$SNAPSHOT_CONTROLLER_YAML") - while [ "$(kubectl get pods -n "$expected_namespace" -l app=snapshot-controller | grep 'Running' -c)" -lt "$expected_running_pods" ]; do + expect_key='app\.kubernetes\.io/name' + expected_label=$(kubectl apply --dry-run=client -o "jsonpath={.spec.template.metadata.labels['$expect_key']}" -f "$SNAPSHOT_CONTROLLER_YAML") + if [ -z "${expected_label}" ]; then + expect_key='app' + expected_label=$(kubectl apply --dry-run=client -o "jsonpath={.spec.template.metadata.labels['$expect_key']}" -f "$SNAPSHOT_CONTROLLER_YAML") + fi + expect_key=${expect_key//\\/} + while [ "$(kubectl get pods -n "$expected_namespace" -l "$expect_key"="$expected_label" | grep 'Running' -c)" -lt "$expected_running_pods" ]; do if [ $cnt -gt 30 ]; then echo "snapshot-controller pod status:" - kubectl describe pods -n "$expected_namespace" -l app=snapshot-controller + kubectl describe pods -n "$expected_namespace" -l "$expect_key"="$expected_label" echo >&2 "ERROR: snapshot controller not ready after over 5 min" exit 1 fi From 5c75b02c3bd2f38541a95569ea4a2e157fdff184 Mon Sep 17 00:00:00 2001 From: Sneha Aradhey Date: Thu, 17 Aug 2023 00:05:30 +0000 Subject: [PATCH 2/2] 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