From c66e140569df5ef776a1e16812422f63405f2d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Fri, 21 Jun 2024 11:52:30 +0200 Subject: [PATCH 1/3] fix: introduce /v5 module suffix for go.mod changes the go.mod path to add /v5 so that go module is resolved properly --- .prow.sh | 2 +- cmd/csi-provisioner/csi-provisioner.go | 14 +++++++------- go.mod | 2 +- pkg/capacity/capacity.go | 2 +- pkg/capacity/capacity_test.go | 2 +- pkg/controller/controller.go | 4 ++-- pkg/controller/controller_test.go | 4 ++-- pkg/controller/fake_translator_test.go | 4 ++-- pkg/controller/topology.go | 2 +- test/e2e/e2e_test.go | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.prow.sh b/.prow.sh index d9f0945dfa..13c0d9e6bd 100755 --- a/.prow.sh +++ b/.prow.sh @@ -1,6 +1,6 @@ #! /bin/bash -CSI_PROW_SIDECAR_E2E_IMPORT_PATH="github.com/kubernetes-csi/external-provisioner/test/e2e" +CSI_PROW_SIDECAR_E2E_IMPORT_PATH="github.com/kubernetes-csi/external-provisioner/v5/test/e2e" . release-tools/prow.sh diff --git a/cmd/csi-provisioner/csi-provisioner.go b/cmd/csi-provisioner/csi-provisioner.go index bdfa022acf..adb34abd33 100644 --- a/cmd/csi-provisioner/csi-provisioner.go +++ b/cmd/csi-provisioner/csi-provisioner.go @@ -38,7 +38,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime/schema" - validation "k8s.io/apimachinery/pkg/util/validation" + "k8s.io/apimachinery/pkg/util/validation" utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" @@ -52,17 +52,17 @@ import ( _ "k8s.io/component-base/metrics/prometheus/clientgo/leaderelection" // register leader election in the default legacy registry _ "k8s.io/component-base/metrics/prometheus/workqueue" // register work queues in the default legacy registry csitrans "k8s.io/csi-translation-lib" - klog "k8s.io/klog/v2" + "k8s.io/klog/v2" "sigs.k8s.io/sig-storage-lib-external-provisioner/v10/controller" libmetrics "sigs.k8s.io/sig-storage-lib-external-provisioner/v10/controller/metrics" "github.com/kubernetes-csi/csi-lib-utils/leaderelection" "github.com/kubernetes-csi/csi-lib-utils/metrics" - "github.com/kubernetes-csi/external-provisioner/pkg/capacity" - "github.com/kubernetes-csi/external-provisioner/pkg/capacity/topology" - ctrl "github.com/kubernetes-csi/external-provisioner/pkg/controller" - "github.com/kubernetes-csi/external-provisioner/pkg/features" - "github.com/kubernetes-csi/external-provisioner/pkg/owner" + "github.com/kubernetes-csi/external-provisioner/v5/pkg/capacity" + "github.com/kubernetes-csi/external-provisioner/v5/pkg/capacity/topology" + ctrl "github.com/kubernetes-csi/external-provisioner/v5/pkg/controller" + "github.com/kubernetes-csi/external-provisioner/v5/pkg/features" + "github.com/kubernetes-csi/external-provisioner/v5/pkg/owner" snapclientset "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned" gatewayclientset "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" gatewayInformers "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions" diff --git a/go.mod b/go.mod index f3958f459e..9ca5b9231c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/kubernetes-csi/external-provisioner +module github.com/kubernetes-csi/external-provisioner/v5 go 1.22.3 diff --git a/pkg/capacity/capacity.go b/pkg/capacity/capacity.go index f885bb727d..22c5a0ea70 100644 --- a/pkg/capacity/capacity.go +++ b/pkg/capacity/capacity.go @@ -27,7 +27,7 @@ import ( "time" "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/kubernetes-csi/external-provisioner/pkg/capacity/topology" + "github.com/kubernetes-csi/external-provisioner/v5/pkg/capacity/topology" "google.golang.org/grpc" v1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" diff --git a/pkg/capacity/capacity_test.go b/pkg/capacity/capacity_test.go index 3c9ff7ff99..ece217d908 100644 --- a/pkg/capacity/capacity_test.go +++ b/pkg/capacity/capacity_test.go @@ -30,7 +30,7 @@ import ( "time" "github.com/container-storage-interface/spec/lib/go/csi" - "github.com/kubernetes-csi/external-provisioner/pkg/capacity/topology" + "github.com/kubernetes-csi/external-provisioner/v5/pkg/capacity/topology" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/protobuf/types/known/wrapperspb" diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index d5011b83bf..1ce19ad680 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -27,7 +27,7 @@ import ( "github.com/container-storage-interface/spec/lib/go/csi" "github.com/kubernetes-csi/csi-lib-utils/accessmodes" - "github.com/kubernetes-csi/external-provisioner/pkg/features" + "github.com/kubernetes-csi/external-provisioner/v5/pkg/features" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -50,7 +50,7 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" - klog "k8s.io/klog/v2" + "k8s.io/klog/v2" "sigs.k8s.io/sig-storage-lib-external-provisioner/v10/controller" "sigs.k8s.io/sig-storage-lib-external-provisioner/v10/util" diff --git a/pkg/controller/controller_test.go b/pkg/controller/controller_test.go index d84ffae2ca..f53c1c4b72 100644 --- a/pkg/controller/controller_test.go +++ b/pkg/controller/controller_test.go @@ -46,14 +46,14 @@ import ( "k8s.io/component-base/featuregate" utilfeaturetesting "k8s.io/component-base/featuregate/testing" csitrans "k8s.io/csi-translation-lib" - klog "k8s.io/klog/v2" + "k8s.io/klog/v2" "sigs.k8s.io/sig-storage-lib-external-provisioner/v10/controller" "github.com/kubernetes-csi/csi-lib-utils/connection" "github.com/kubernetes-csi/csi-lib-utils/metrics" "github.com/kubernetes-csi/csi-lib-utils/rpc" "github.com/kubernetes-csi/csi-test/v5/driver" - "github.com/kubernetes-csi/external-provisioner/pkg/features" + "github.com/kubernetes-csi/external-provisioner/v5/pkg/features" crdv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1" "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/fake" gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" diff --git a/pkg/controller/fake_translator_test.go b/pkg/controller/fake_translator_test.go index 38b78c8a5a..c8d0ba6ad2 100644 --- a/pkg/controller/fake_translator_test.go +++ b/pkg/controller/fake_translator_test.go @@ -1,10 +1,10 @@ // Automatically generated by MockGen. DO NOT EDIT! -// Source: github.com/kubernetes-csi/external-provisioner/pkg/controller (interfaces: ProvisionerCSITranslator) +// Source: github.com/kubernetes-csi/external-provisioner/v5/pkg/controller (interfaces: ProvisionerCSITranslator) package controller import ( - gomock "github.com/golang/mock/gomock" + "github.com/golang/mock/gomock" v1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" ) diff --git a/pkg/controller/topology.go b/pkg/controller/topology.go index 21968e347d..93aaf7a9b1 100644 --- a/pkg/controller/topology.go +++ b/pkg/controller/topology.go @@ -26,7 +26,7 @@ import ( "github.com/container-storage-interface/spec/lib/go/csi" "github.com/kubernetes-csi/csi-lib-utils/rpc" - "github.com/kubernetes-csi/external-provisioner/pkg/features" + "github.com/kubernetes-csi/external-provisioner/v5/pkg/features" v1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 03aec7c774..bd58903b61 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -12,7 +12,7 @@ import ( "k8s.io/kubernetes/test/e2e/framework/config" // test sources - _ "github.com/kubernetes-csi/external-provisioner/test/e2e/storage" + _ "github.com/kubernetes-csi/external-provisioner/v5/test/e2e/storage" ) func TestMain(m *testing.M) { From 67d070a0f46cddd029f2d1e4f29b5ddfdd19c7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Mon, 15 Jul 2024 09:04:26 +0200 Subject: [PATCH 2/3] Squashed 'release-tools/' changes from 379a1bb9b..988496a1f 988496a1f Merge pull request #257 from jakobmoellerdev/csi-prow-sidecar-e2e-path 028f8c698 chore: bump to Go 1.22.5 69bd71e8a chore: add CSI_PROW_SIDECAR_E2E_PATH f40f0ccd4 Merge pull request #256 from solumath/master cfa92106c Instruction update git-subtree-dir: release-tools git-subtree-split: 988496a1fc3849ed793e03012fdd56813d13d46c --- generate-patch-release-notes.sh | 16 ++++++++++------ prow.sh | 11 +++++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/generate-patch-release-notes.sh b/generate-patch-release-notes.sh index 2b9c13c387..536a149023 100755 --- a/generate-patch-release-notes.sh +++ b/generate-patch-release-notes.sh @@ -23,13 +23,17 @@ # CSI_RELEASE_TOKEN: Github token needed for generating release notes # GITHUB_USER: Github username to create PRs with # +# Required tools: +# - gh +# - release-notes (https://github.com/kubernetes/release/blob/master/cmd/release-notes/README.md) +# # Instructions: -# 1. Login with "gh auth login" -# 2. Copy this script to the kubernetes-csi directory (one directory above the -# repos) -# 3. Update the repos and versions in the $releases array -# 4. Set environment variables -# 5. Run script from the kubernetes-csi directory +# 1. Install the required tools +# 2. Login with "gh auth login" +# 3. Copy this script to the kubernetes-csi directory (one directory above the repos) +# 4. Update the repos and versions in the $releases array +# 5. Set environment variables +# 6. Run script from the kubernetes-csi directory # # Caveats: # - This script doesn't handle regenerating and updating existing PRs yet. diff --git a/prow.sh b/prow.sh index 049fb79afc..df8c61502f 100755 --- a/prow.sh +++ b/prow.sh @@ -86,7 +86,7 @@ configvar CSI_PROW_BUILD_PLATFORMS "linux amd64 amd64; linux ppc64le ppc64le -pp # which is disabled with GOFLAGS=-mod=vendor). configvar GOFLAGS_VENDOR "$( [ -d vendor ] && echo '-mod=vendor' )" "Go flags for using the vendor directory" -configvar CSI_PROW_GO_VERSION_BUILD "1.22.3" "Go version for building the component" # depends on component's source code +configvar CSI_PROW_GO_VERSION_BUILD "1.22.5" "Go version for building the component" # depends on component's source code configvar CSI_PROW_GO_VERSION_E2E "" "override Go version for building the Kubernetes E2E test suite" # normally doesn't need to be set, see install_e2e configvar CSI_PROW_GO_VERSION_SANITY "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building the csi-sanity test suite" # depends on CSI_PROW_SANITY settings below configvar CSI_PROW_GO_VERSION_KIND "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building 'kind'" # depends on CSI_PROW_KIND_VERSION below @@ -231,8 +231,11 @@ configvar CSI_PROW_E2E_VERSION "$(version_to_git "${CSI_PROW_KUBERNETES_VERSION} configvar CSI_PROW_E2E_REPO "https://github.com/kubernetes/kubernetes" "E2E repo" configvar CSI_PROW_E2E_IMPORT_PATH "k8s.io/kubernetes" "E2E package" -# Local path for e2e tests. Set to "none" to disable. -configvar CSI_PROW_SIDECAR_E2E_IMPORT_PATH "none" "CSI Sidecar E2E package" +# Local path & package path for e2e tests. Set to "none" to disable. +# When using versioned go modules, the import path is the module path whereas the path +# should not contain the version and be the directory where the module is checked out. +configvar CSI_PROW_SIDECAR_E2E_IMPORT_PATH "none" "CSI Sidecar E2E package (go import path)" +configvar CSI_PROW_SIDECAR_E2E_PATH "${CSI_PROW_SIDECAR_E2E_IMPORT_PATH}" "CSI Sidecar E2E path (directory)" # csi-sanity testing from the csi-test repo can be run against the installed # CSI driver. For this to work, deploying the driver must expose the Unix domain @@ -1035,7 +1038,7 @@ run_e2e () ( trap move_junit EXIT if [ "${name}" == "local" ]; then - cd "${GOPATH}/src/${CSI_PROW_SIDECAR_E2E_IMPORT_PATH}" && + cd "${GOPATH}/src/${CSI_PROW_SIDECAR_E2E_PATH}" && run_with_loggers env KUBECONFIG="$KUBECONFIG" KUBE_TEST_REPO_LIST="$(if [ -e "${CSI_PROW_WORK}/e2e-repo-list" ]; then echo "${CSI_PROW_WORK}/e2e-repo-list"; fi)" ginkgo --timeout="${CSI_PROW_GINKGO_TIMEOUT}" -v "$@" "${CSI_PROW_WORK}/e2e-local.test" -- -report-dir "${ARTIFACTS}" -report-prefix local else cd "${GOPATH}/src/${CSI_PROW_E2E_IMPORT_PATH}" && From 3126c977c5ef517ce0082f30c6a13f51439ba6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20M=C3=B6ller?= Date: Mon, 15 Jul 2024 09:05:41 +0200 Subject: [PATCH 3/3] fix: fixup paths for sidecar run --- .prow.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.prow.sh b/.prow.sh index 13c0d9e6bd..7dc8054716 100755 --- a/.prow.sh +++ b/.prow.sh @@ -1,6 +1,7 @@ #! /bin/bash CSI_PROW_SIDECAR_E2E_IMPORT_PATH="github.com/kubernetes-csi/external-provisioner/v5/test/e2e" +CSI_PROW_SIDECAR_E2E_PATH="github.com/kubernetes-csi/external-provisioner/test/e2e" . release-tools/prow.sh