diff --git a/cmd/csi-provisioner/csi-provisioner.go b/cmd/csi-provisioner/csi-provisioner.go index 4cb07e693b..419c9351c5 100644 --- a/cmd/csi-provisioner/csi-provisioner.go +++ b/cmd/csi-provisioner/csi-provisioner.go @@ -79,11 +79,8 @@ import ( var ( master = flag.String("master", "", "Master URL to build a client config from. Either this or kubeconfig needs to be set if the provisioner is being run out of cluster.") - kubeconfig = flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Either this or master needs to be set if the provisioner is being run out of cluster.") - csiEndpoint = flag.String("csi-address", "/run/csi/socket", "The gRPC endpoint for Target CSI Volume.") volumeNamePrefix = flag.String("volume-name-prefix", "pvc", "Prefix to apply to the name of a created volume.") volumeNameUUIDLength = flag.Int("volume-name-uuid-length", -1, "Truncates generated UUID of a created volume to this length. Defaults behavior is to NOT truncate.") - showVersion = flag.Bool("version", false, "Show version.") retryIntervalStart = flag.Duration("retry-interval-start", time.Second, "Initial retry interval of failed provisioning or deletion. It doubles with each failure, up to retry-interval-max.") retryIntervalMax = flag.Duration("retry-interval-max", 5*time.Minute, "Maximum retry interval of failed provisioning or deletion.") workerThreads = flag.Uint("worker-threads", 100, "Number of provisioner worker threads, in other words nr. of simultaneous CSI calls.") @@ -91,26 +88,13 @@ var ( capacityThreads = flag.Uint("capacity-threads", 1, "Number of simultaneously running threads, handling CSIStorageCapacity objects") operationTimeout = flag.Duration("timeout", 10*time.Second, "Timeout for waiting for volume operation (creation, deletion, capacity queries)") - enableLeaderElection = flag.Bool("leader-election", false, "Enables leader election. If leader election is enabled, additional RBAC rules are required. Please refer to the Kubernetes CSI documentation for instructions on setting up these RBAC rules.") - - leaderElectionNamespace = flag.String("leader-election-namespace", "", "Namespace where the leader election resource lives. Defaults to the pod namespace if not set.") - strictTopology = flag.Bool("strict-topology", false, "Late binding: pass only selected node topology to CreateVolume Request, unlike default behavior of passing aggregated cluster topologies that match with topology keys of the selected node.") - immediateTopology = flag.Bool("immediate-topology", true, "Immediate binding: pass aggregated cluster topologies for all nodes where the CSI driver is available (enabled, the default) or no topology requirements (if disabled).") - extraCreateMetadata = flag.Bool("extra-create-metadata", false, "If set, add pv/pvc metadata to plugin create requests as parameters.") - metricsAddress = flag.String("metrics-address", "", "(deprecated) The TCP network address where the prometheus metrics endpoint will listen (example: `:8080`). The default is empty string, which means metrics endpoint is disabled. Only one of `--metrics-address` and `--http-endpoint` can be set.") - httpEndpoint = flag.String("http-endpoint", "", "The TCP network address where the HTTP server for diagnostics, including pprof, metrics and leader election health check, will listen (example: `:8080`). The default is empty string, which means the server is disabled. Only one of `--metrics-address` and `--http-endpoint` can be set.") - metricsPath = flag.String("metrics-path", "/metrics", "The HTTP path where prometheus metrics will be exposed. Default is `/metrics`.") - enableProfile = flag.Bool("enable-pprof", false, "Enable pprof profiling on the TCP network address specified by --http-endpoint. The HTTP path is `/debug/pprof/`.") - - leaderElectionLeaseDuration = flag.Duration("leader-election-lease-duration", 15*time.Second, "Duration, in seconds, that non-leader candidates will wait to force acquire leadership. Defaults to 15 seconds.") - leaderElectionRenewDeadline = flag.Duration("leader-election-renew-deadline", 10*time.Second, "Duration, in seconds, that the acting leader will retry refreshing leadership before giving up. Defaults to 10 seconds.") - leaderElectionRetryPeriod = flag.Duration("leader-election-retry-period", 5*time.Second, "Duration, in seconds, the LeaderElector clients should wait between tries of actions. Defaults to 5 seconds.") + strictTopology = flag.Bool("strict-topology", false, "Late binding: pass only selected node topology to CreateVolume Request, unlike default behavior of passing aggregated cluster topologies that match with topology keys of the selected node.") + immediateTopology = flag.Bool("immediate-topology", true, "Immediate binding: pass aggregated cluster topologies for all nodes where the CSI driver is available (enabled, the default) or no topology requirements (if disabled).") + extraCreateMetadata = flag.Bool("extra-create-metadata", false, "If set, add pv/pvc metadata to plugin create requests as parameters.") + enableProfile = flag.Bool("enable-pprof", false, "Enable pprof profiling on the TCP network address specified by --http-endpoint. The HTTP path is `/debug/pprof/`.") defaultFSType = flag.String("default-fstype", "", "The default filesystem type of the volume to provision when fstype is unspecified in the StorageClass. If the default is not set and fstype is unset in the StorageClass, then no fstype will be set") - kubeAPIQPS = flag.Float32("kube-api-qps", 5, "QPS to use while communicating with the kubernetes apiserver. Defaults to 5.0.") - kubeAPIBurst = flag.Int("kube-api-burst", 10, "Burst to use while communicating with the kubernetes apiserver. Defaults to 10.") - kubeAPICapacityQPS = flag.Float32("kube-api-capacity-qps", 1, "QPS to use for storage capacity updates while communicating with the kubernetes apiserver. Defaults to 1.0.") kubeAPICapacityBurst = flag.Int("kube-api-capacity-burst", 5, "Burst to use for storage capacity updates while communicating with the kubernetes apiserver. Defaults to 5.") @@ -144,6 +128,7 @@ func main() { c := logsapi.NewLoggingConfiguration() logsapi.AddFlags(c, flag.CommandLine) logs.InitLogs() + standardflags.RegisterCommonFlags(goflag.CommandLine) standardflags.AddAutomaxprocs(klog.Infof) flag.CommandLine.AddGoFlagSet(goflag.CommandLine) flag.Parse() @@ -163,19 +148,19 @@ func main() { klog.Fatal("The NODE_NAME environment variable must be set when using --enable-node-deployment.") } - if *showVersion { + if standardflags.Configuration.ShowVersion { fmt.Println(os.Args[0], version) os.Exit(0) } klog.InfoS("Version", "version", version) - if *metricsAddress != "" && *httpEndpoint != "" { + if standardflags.Configuration.MetricsAddress != "" && standardflags.Configuration.HttpEndpoint != "" { klog.Error("only one of `--metrics-address` and `--http-endpoint` can be set.") os.Exit(1) } - addr := *metricsAddress + addr := standardflags.Configuration.MetricsAddress if addr == "" { - addr = *httpEndpoint + addr = standardflags.Configuration.HttpEndpoint } // get the KUBECONFIG from env if specified (useful for local/debug cluster) @@ -183,12 +168,12 @@ func main() { if kubeconfigEnv != "" { klog.Infof("Found KUBECONFIG environment variable set, using that..") - kubeconfig = &kubeconfigEnv + standardflags.Configuration.KubeConfig = kubeconfigEnv } - if *master != "" || *kubeconfig != "" { + if *master != "" || standardflags.Configuration.KubeConfig != "" { klog.Infof("Either master or kubeconfig specified. building kube config from that..") - config, err = clientcmd.BuildConfigFromFlags(*master, *kubeconfig) + config, err = clientcmd.BuildConfigFromFlags(*master, standardflags.Configuration.KubeConfig) } else { klog.Infof("Building kube configs for running in cluster...") config, err = rest.InClusterConfig() @@ -197,8 +182,8 @@ func main() { klog.Fatalf("Failed to create config: %v", err) } - config.QPS = *kubeAPIQPS - config.Burst = *kubeAPIBurst + config.QPS = float32(standardflags.Configuration.KubeAPIQPS) + config.Burst = standardflags.Configuration.KubeAPIBurst coreConfig := rest.CopyConfig(config) coreConfig.ContentType = runtime.ContentTypeProtobuf @@ -240,7 +225,7 @@ func main() { metrics.WithSubsystem(metrics.SubsystemSidecar), ) - grpcClient, err := ctrl.Connect(ctx, *csiEndpoint, metricsManager) + grpcClient, err := ctrl.Connect(ctx, standardflags.Configuration.CSIAddress, metricsManager) if err != nil { klog.Error(err.Error()) os.Exit(1) @@ -274,7 +259,7 @@ func main() { // Will be provided via default gatherer. metrics.WithProcessStartTime(false), metrics.WithMigration()) - migratedGrpcClient, err := ctrl.Connect(ctx, *csiEndpoint, metricsManager) + migratedGrpcClient, err := ctrl.Connect(ctx, standardflags.Configuration.CSIAddress, metricsManager) if err != nil { klog.Error(err.Error()) os.Exit(1) @@ -613,14 +598,14 @@ func main() { // because both CSI metrics manager and component-base manage // their own registry. Probably could be avoided by making // CSI metrics manager a bit more flexible. - mux.Handle(*metricsPath, + mux.Handle(standardflags.Configuration.MetricsPath, promhttp.InstrumentMetricHandler( reg, promhttp.HandlerFor(gatherers, promhttp.HandlerOpts{}), )) if *enableProfile { - klog.InfoS("Starting profiling", "endpoint", httpEndpoint) + klog.InfoS("Starting profiling", "endpoint", standardflags.Configuration.HttpEndpoint) mux.HandleFunc("/debug/pprof/", pprof.Index) mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline) @@ -632,7 +617,7 @@ func main() { klog.Infof("ServeMux listening at %q", addr) err := http.ListenAndServe(addr, mux) if err != nil { - klog.Fatalf("Failed to start HTTP server at specified address (%q) and metrics path (%q): %s", addr, *metricsPath, err) + klog.Fatalf("Failed to start HTTP server at specified address (%q) and metrics path (%q): %s", addr, standardflags.Configuration.MetricsPath, err) } }() } @@ -734,39 +719,13 @@ func main() { } } - if !*enableLeaderElection { - run(ctx) - } else { - // this lock name pattern is also copied from sigs.k8s.io/sig-storage-lib-external-provisioner/controller - // to preserve backwards compatibility - lockName := strings.Replace(provisionerName, "/", "-", -1) - - // create a new clientset for leader election - leClientset, err := kubernetes.NewForConfig(coreConfig) - if err != nil { - klog.Fatalf("Failed to create leaderelection client: %v", err) - } - - le := leaderelection.NewLeaderElection(leClientset, lockName, run) - if *httpEndpoint != "" { - le.PrepareHealthCheck(mux, leaderelection.DefaultHealthCheckTimeout) - } - - if *leaderElectionNamespace != "" { - le.WithNamespace(*leaderElectionNamespace) - } - - le.WithLeaseDuration(*leaderElectionLeaseDuration) - le.WithRenewDeadline(*leaderElectionRenewDeadline) - le.WithRetryPeriod(*leaderElectionRetryPeriod) - le.WithIdentity(identity) - if utilfeature.DefaultFeatureGate.Enabled(features.ReleaseLeaderElectionOnExit) { - le.WithReleaseOnCancel(true) - le.WithContext(ctx) - } - - if err := le.Run(); err != nil { - klog.Fatalf("failed to initialize leader election: %v", err) - } - } + leaderelection.RunWithLeaderElection( + ctx, + config, + standardflags.Configuration, + run, + strings.Replace(provisionerName, "/", "-", -1), + mux, + utilfeature.DefaultFeatureGate.Enabled(features.ReleaseLeaderElectionOnExit), + ) } diff --git a/go.mod b/go.mod index 5eb7e79586..9b06b4fc26 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,13 @@ module github.com/kubernetes-csi/external-provisioner/v5 -go 1.24.2 +go 1.24.6 require ( github.com/container-storage-interface/spec v1.12.0 github.com/golang/mock v1.6.0 github.com/google/uuid v1.6.0 // indirect - github.com/kubernetes-csi/csi-lib-utils v0.22.0 - github.com/kubernetes-csi/csi-test/v5 v5.4.0 + github.com/kubernetes-csi/csi-lib-utils v0.23.0 + github.com/kubernetes-csi/csi-test/v5 v5.3.1 github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0 github.com/miekg/dns v1.1.68 // indirect github.com/prometheus/client_golang v1.23.2 diff --git a/go.sum b/go.sum index 94c200e18c..05a5d58ef2 100644 --- a/go.sum +++ b/go.sum @@ -124,10 +124,10 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubernetes-csi/csi-lib-utils v0.22.0 h1:EUAs1+uHGps3OtVj4XVx16urhpI02eu+Z8Vps6plpHY= -github.com/kubernetes-csi/csi-lib-utils v0.22.0/go.mod h1:f+PalKyS4Ujsjb9+m6Rj0W6c28y3nfea3paQ/VqjI28= -github.com/kubernetes-csi/csi-test/v5 v5.4.0 h1:u5DgYNIreSNO2+u4Nq2Wpl+bbakRSjNyxZHmDTAqnYA= -github.com/kubernetes-csi/csi-test/v5 v5.4.0/go.mod h1:anAJKFUb/SdHhIHECgSKxC5LSiLzib+1I6mrWF5Hve8= +github.com/kubernetes-csi/csi-lib-utils v0.23.0 h1:070SC4ubEvJpQak0ibxgv7l5dUoDVdqKyktam6zkm4s= +github.com/kubernetes-csi/csi-lib-utils v0.23.0/go.mod h1:H5+JRXAvb7lpC4nrddI7sfQfaXA1O8Tek3uNrTIx1/g= +github.com/kubernetes-csi/csi-test/v5 v5.3.1 h1:Wiukp1In+kif+BFo6q2ExjgB+MbrAz4jZWzGfijypuY= +github.com/kubernetes-csi/csi-test/v5 v5.3.1/go.mod h1:7hA2cSYJ6T8CraEZPA6zqkLZwemjBD54XAnPsPC3VpA= github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0 h1:Q3jQ1NkFqv5o+F8dMmHd8SfEmlcwNeo1immFApntEwE= github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0/go.mod h1:E3vdYxHj2C2q6qo8/Da4g7P+IcwqRZyy3gJBzYybV9Y= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/leaderelection/leader_election.go b/vendor/github.com/kubernetes-csi/csi-lib-utils/leaderelection/leader_election.go index 4045127c5d..b67de54f09 100644 --- a/vendor/github.com/kubernetes-csi/csi-lib-utils/leaderelection/leader_election.go +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/leaderelection/leader_election.go @@ -25,10 +25,12 @@ import ( "strings" "time" + "github.com/kubernetes-csi/csi-lib-utils/standardflags" v1 "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" + "k8s.io/client-go/rest" "k8s.io/client-go/tools/leaderelection" "k8s.io/client-go/tools/leaderelection/resourcelock" "k8s.io/client-go/tools/record" @@ -77,6 +79,8 @@ type leaderElection struct { ctx context.Context clientset kubernetes.Interface + + labels map[string]string } // NewLeaderElection returns the default & preferred leader election type @@ -122,6 +126,11 @@ func (l *leaderElection) WithReleaseOnCancel(releaseOnCancel bool) { l.releaseOnCancel = releaseOnCancel } +// WithLabels adds labels to the lease object when this instance becomes leader +func (l *leaderElection) WithLabels(labels map[string]string) { + l.labels = labels +} + // WithContext Add context func (l *leaderElection) WithContext(ctx context.Context) { l.ctx = ctx @@ -176,8 +185,7 @@ func (l *leaderElection) Run() error { Identity: sanitizeName(l.identity), EventRecorder: eventRecorder, } - - lock, err := resourcelock.New(l.resourceLock, l.namespace, sanitizeName(l.lockName), l.clientset.CoreV1(), l.clientset.CoordinationV1(), rlConfig) + lock, err := resourcelock.NewWithLabels(l.resourceLock, l.namespace, sanitizeName(l.lockName), l.clientset.CoreV1(), l.clientset.CoordinationV1(), rlConfig, l.labels) if err != nil { return err } @@ -209,6 +217,58 @@ func (l *leaderElection) Run() error { return nil // should never reach here } +func RunWithLeaderElection( + ctx context.Context, + config *rest.Config, + opts standardflags.SidecarConfiguration, + run func(context.Context), + driverName string, + mux *http.ServeMux, + releaseOnExit bool) { + + logger := klog.FromContext(ctx) + + if !opts.LeaderElection { + run(ctx) + } else { + // Create a new clientset for leader election. When the attacher + // gets busy and its client gets throttled, the leader election + // can proceed without issues. + leClientset, err := kubernetes.NewForConfig(config) + if err != nil { + logger.Error(err, "Failed to create leaderelection client") + klog.FlushAndExit(klog.ExitFlushTimeout, 1) + } + + // Name of config map with leader election lock + le := NewLeaderElection(leClientset, driverName, run) + if opts.HttpEndpoint != "" { + le.PrepareHealthCheck(mux, DefaultHealthCheckTimeout) + } + + if opts.LeaderElectionNamespace != "" { + le.WithNamespace(opts.LeaderElectionNamespace) + } + + if opts.LeaderElectionLabels != nil { + le.WithLabels(opts.LeaderElectionLabels) + } + + le.WithLeaseDuration(opts.LeaderElectionLeaseDuration) + le.WithRenewDeadline(opts.LeaderElectionRenewDeadline) + le.WithRetryPeriod(opts.LeaderElectionRetryPeriod) + if releaseOnExit { + le.WithReleaseOnCancel(true) + le.WithContext(ctx) + } + + if err := le.Run(); err != nil { + logger.Error(err, "Failed to initialize leader election") + klog.FlushAndExit(klog.ExitFlushTimeout, 1) + } + } +} + func defaultLeaderElectionIdentity() (string, error) { return os.Hostname() } diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/standardflags/flags.go b/vendor/github.com/kubernetes-csi/csi-lib-utils/standardflags/flags.go new file mode 100644 index 0000000000..54a2d12e3f --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/standardflags/flags.go @@ -0,0 +1,83 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package standardflags + +import ( + "flag" + "fmt" + "strings" + "time" +) + +type SidecarConfiguration struct { + ShowVersion bool + + KubeConfig string + CSIAddress string + + LeaderElection bool + LeaderElectionNamespace string + LeaderElectionLeaseDuration time.Duration + LeaderElectionRenewDeadline time.Duration + LeaderElectionRetryPeriod time.Duration + LeaderElectionLabels stringMap + + KubeAPIQPS float64 + KubeAPIBurst int + + HttpEndpoint string + MetricsAddress string + MetricsPath string +} + +var Configuration = SidecarConfiguration{} + +func RegisterCommonFlags(flags *flag.FlagSet) { + flags.BoolVar(&Configuration.ShowVersion, "version", false, "Show version.") + flags.StringVar(&Configuration.KubeConfig, "kubeconfig", "", "Absolute path to the kubeconfig file. Required only when running out of cluster.") + flags.StringVar(&Configuration.CSIAddress, "csi-address", "/run/csi/socket", "The gRPC endpoint for Target CSI Volume.") + flags.BoolVar(&Configuration.LeaderElection, "leader-election", false, "Enable leader election.") + flags.StringVar(&Configuration.LeaderElectionNamespace, "leader-election-namespace", "", "Namespace where the leader election resource lives. Defaults to the pod namespace if not set.") + flags.DurationVar(&Configuration.LeaderElectionLeaseDuration, "leader-election-lease-duration", 15*time.Second, "Duration, in seconds, that non-leader candidates will wait to force acquire leadership. Defaults to 15 seconds.") + flags.DurationVar(&Configuration.LeaderElectionRenewDeadline, "leader-election-renew-deadline", 10*time.Second, "Duration, in seconds, that the acting leader will retry refreshing leadership before giving up. Defaults to 10 seconds.") + flags.DurationVar(&Configuration.LeaderElectionRetryPeriod, "leader-election-retry-period", 5*time.Second, "Duration, in seconds, the LeaderElector clients should wait between tries of actions. Defaults to 5 seconds.") + flags.Var(&Configuration.LeaderElectionLabels, "leader-election-labels", "List of labels to add to lease when given replica becomes leader. Formatted as a comma seperated list of key:value labels. Example: 'my-label:my-value,my-second-label:my-second-value'") + flags.Float64Var(&Configuration.KubeAPIQPS, "kube-api-qps", 5, "QPS to use while communicating with the kubernetes apiserver. Defaults to 5.0.") + flags.IntVar(&Configuration.KubeAPIBurst, "kube-api-burst", 10, "Burst to use while communicating with the kubernetes apiserver. Defaults to 10.") + flags.StringVar(&Configuration.HttpEndpoint, "http-endpoint", "", "The TCP network address where the HTTP server for diagnostics, including metrics and leader election health check, will listen (example: `:8080`). The default is empty string, which means the server is disabled. Only one of `--metrics-address` and `--http-endpoint` can be set.") + flags.StringVar(&Configuration.MetricsAddress, "metrics-address", "", "(deprecated) The TCP network address where the prometheus metrics endpoint will listen (example: `:8080`). The default is empty string, which means metrics endpoint is disabled. Only one of `--metrics-address` and `--http-endpoint` can be set.") + flag.StringVar(&Configuration.MetricsPath, "metrics-path", "/metrics", "The HTTP path where prometheus metrics will be exposed. Default is `/metrics`.") +} + +type stringMap map[string]string + +func (sm *stringMap) String() string { + return fmt.Sprintf("%s", *sm) +} + +func (sm *stringMap) Set(value string) error { + outMap := *sm + items := strings.Split(value, ",") + for _, i := range items { + label := strings.Split(i, ":") + if len(label) != 2 { + return fmt.Errorf("malformed item in list of labels: %s", i) + } + outMap[label[0]] = label[1] + } + return nil +} diff --git a/vendor/github.com/kubernetes-csi/csi-test/v5/driver/driver.mock.go b/vendor/github.com/kubernetes-csi/csi-test/v5/driver/driver.mock.go index c257f73bcd..e8da0ba98d 100644 --- a/vendor/github.com/kubernetes-csi/csi-test/v5/driver/driver.mock.go +++ b/vendor/github.com/kubernetes-csi/csi-test/v5/driver/driver.mock.go @@ -280,21 +280,6 @@ func (mr *MockControllerServerMockRecorder) GetCapacity(arg0, arg1 interface{}) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCapacity", reflect.TypeOf((*MockControllerServer)(nil).GetCapacity), arg0, arg1) } -// GetSnapshot mocks base method. -func (m *MockControllerServer) GetSnapshot(arg0 context.Context, arg1 *csi.GetSnapshotRequest) (*csi.GetSnapshotResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSnapshot", arg0, arg1) - ret0, _ := ret[0].(*csi.GetSnapshotResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetSnapshot indicates an expected call of GetSnapshot. -func (mr *MockControllerServerMockRecorder) GetSnapshot(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSnapshot", reflect.TypeOf((*MockControllerServer)(nil).GetSnapshot), arg0, arg1) -} - // ListSnapshots mocks base method. func (m *MockControllerServer) ListSnapshots(arg0 context.Context, arg1 *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) { m.ctrl.T.Helper() diff --git a/vendor/modules.txt b/vendor/modules.txt index 6506906943..fce67936b8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -190,8 +190,8 @@ github.com/josharian/intern # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/kubernetes-csi/csi-lib-utils v0.22.0 -## explicit; go 1.24.0 +# github.com/kubernetes-csi/csi-lib-utils v0.23.0 +## explicit; go 1.24.6 github.com/kubernetes-csi/csi-lib-utils/accessmodes github.com/kubernetes-csi/csi-lib-utils/connection github.com/kubernetes-csi/csi-lib-utils/leaderelection @@ -200,8 +200,8 @@ github.com/kubernetes-csi/csi-lib-utils/protosanitizer github.com/kubernetes-csi/csi-lib-utils/rpc github.com/kubernetes-csi/csi-lib-utils/slowset github.com/kubernetes-csi/csi-lib-utils/standardflags -# github.com/kubernetes-csi/csi-test/v5 v5.4.0 -## explicit; go 1.23.0 +# github.com/kubernetes-csi/csi-test/v5 v5.3.1 +## explicit; go 1.18 github.com/kubernetes-csi/csi-test/v5/driver github.com/kubernetes-csi/csi-test/v5/utils # github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0