diff --git a/.travis.yml b/.travis.yml index f05840698..89f0c8279 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ services: - docker language: go go: - - 1.19.x + - 1.18.x install: - go install github.com/vbatts/git-validation@v1.1.0 - curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl diff --git a/api/client/volume/client.go b/api/client/volume/client.go index 57456886b..23af1a878 100644 --- a/api/client/volume/client.go +++ b/api/client/volume/client.go @@ -452,7 +452,8 @@ func (v *volumeClient) Unmount(ctx context.Context, volumeID string, mountPath s } // Update volume -func (v *volumeClient) Set(ctx context.Context, volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error { +func (v *volumeClient) Set(volumeID string, locator *api.VolumeLocator, + spec *api.VolumeSpec) error { return v.doVolumeSet(correlation.TODO(), volumeID, &api.VolumeSetRequest{ diff --git a/api/server/middleware_auth.go b/api/server/middleware_auth.go index 276d9f6da..6a261978d 100644 --- a/api/server/middleware_auth.go +++ b/api/server/middleware_auth.go @@ -205,7 +205,7 @@ func (a *authMiddleware) setWithAuth(w http.ResponseWriter, r *http.Request, nex if req.Spec != nil && req.Spec.Size > 0 { isOpDone = true - err = d.Set(ctx, volumeID, req.Locator, req.Spec) + err = d.Set(volumeID, req.Locator, req.Spec) } for err == nil && req.Action != nil { diff --git a/api/server/sdk/volume_ops.go b/api/server/sdk/volume_ops.go index f0e898f81..956efd8be 100644 --- a/api/server/sdk/volume_ops.go +++ b/api/server/sdk/volume_ops.go @@ -729,7 +729,7 @@ func (s *VolumeServer) Update( maskUnModified(updatedSpec, req.GetSpec()) // Send to driver - if err := s.driver(ctx).Set(ctx, req.GetVolumeId(), locator, updatedSpec); err != nil { + if err := s.driver(ctx).Set(req.GetVolumeId(), locator, updatedSpec); err != nil { return nil, status.Errorf(codes.Internal, "Failed to update volume: %v", err) } diff --git a/api/server/sdk/volume_ops_test.go b/api/server/sdk/volume_ops_test.go index a4b86f85d..efd9c4c84 100644 --- a/api/server/sdk/volume_ops_test.go +++ b/api/server/sdk/volume_ops_test.go @@ -647,7 +647,7 @@ func TestSdkVolumeUpdate(t *testing.T) { AnyTimes() s.MockDriver(). EXPECT(). - Set(gomock.Any(), id, &api.VolumeLocator{VolumeLabels: newlabels}, &api.VolumeSpec{SnapshotInterval: math.MaxUint32}). + Set(id, &api.VolumeLocator{VolumeLabels: newlabels}, &api.VolumeSpec{SnapshotInterval: math.MaxUint32}). Return(nil). Times(1) @@ -668,7 +668,7 @@ func TestSdkVolumeUpdate(t *testing.T) { s.MockDriver(). EXPECT(). - Set(gomock.Any(), id, nil, &api.VolumeSpec{Size: 1234, SnapshotInterval: math.MaxUint32}). + Set(id, nil, &api.VolumeSpec{Size: 1234, SnapshotInterval: math.MaxUint32}). Return(nil). Times(1) _, err = c.Update(context.Background(), req) @@ -687,7 +687,7 @@ func TestSdkVolumeUpdate(t *testing.T) { s.MockDriver(). EXPECT(). - Set(gomock.Any(), + Set( id, &api.VolumeLocator{VolumeLabels: newlabels}, &api.VolumeSpec{Size: 1234, SnapshotInterval: math.MaxUint32}, @@ -1156,7 +1156,7 @@ func TestSdkCloneOwnership(t *testing.T) { Times(1), mv. EXPECT(). - Set(gomock.Any(), id, nil, &api.VolumeSpec{ + Set(id, nil, &api.VolumeSpec{ Size: 1234, Ownership: &api.Ownership{ Owner: user2, @@ -1283,7 +1283,7 @@ func TestSdkCloneOwnership(t *testing.T) { Times(1), mv. EXPECT(). - Set(gomock.Any(), id, nil, &api.VolumeSpec{ + Set(id, nil, &api.VolumeSpec{ Size: 1234, Ownership: &api.Ownership{ Owner: user2, @@ -1803,7 +1803,7 @@ func TestSdkVolumeUpdatePolicyOwnership(t *testing.T) { AnyTimes() mv. EXPECT(). - Set(gomock.Any(), id, nil, volPolSpec). + Set(id, nil, volPolSpec). Return(nil). Times(1) diff --git a/api/server/sdk/volume_snapshot_test.go b/api/server/sdk/volume_snapshot_test.go index 3e432582e..25e1d27e6 100644 --- a/api/server/sdk/volume_snapshot_test.go +++ b/api/server/sdk/volume_snapshot_test.go @@ -6,7 +6,7 @@ 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 + 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, @@ -18,7 +18,6 @@ package sdk import ( "context" - "github.com/golang/mock/gomock" "math" "testing" @@ -312,7 +311,7 @@ func TestSdkVolumeSnapshotScheduleUpdate(t *testing.T) { Times(1) s.MockDriver(). EXPECT(). - Set(gomock.Any(), volid, nil, &api.VolumeSpec{ + Set(volid, nil, &api.VolumeSpec{ SnapshotSchedule: "policy=mypolicy", SnapshotInterval: math.MaxUint32, }). @@ -349,7 +348,7 @@ func TestSdkVolumeSnapshotScheduleUpdateDelete(t *testing.T) { AnyTimes() s.MockDriver(). EXPECT(). - Set(gomock.Any(), volid, nil, &api.VolumeSpec{ + Set(volid, nil, &api.VolumeSpec{ SnapshotSchedule: "", SnapshotInterval: math.MaxUint32, }). diff --git a/api/server/volume_test.go b/api/server/volume_test.go index 485728546..df791c574 100644 --- a/api/server/volume_test.go +++ b/api/server/volume_test.go @@ -123,7 +123,7 @@ func TestVolumeNoAuth(t *testing.T) { newspec := req.GetSpec() newspec.Size = newsize - resp := driverclient.Set(context.TODO(), id, req.GetLocator(), newspec) + resp := driverclient.Set(id, req.GetLocator(), newspec) assert.Nil(t, resp) // INSPECT @@ -792,7 +792,7 @@ func TestVolumeSetSuccess(t *testing.T) { Spec: &api.VolumeSpec{Size: newsize}, } - res := driverclient.Set(context.TODO(), id, req.GetLocator(), req2.GetSpec()) + res := driverclient.Set(id, req.GetLocator(), req2.GetSpec()) assert.Nil(t, res) // Assert volume information is correct @@ -807,11 +807,13 @@ func TestVolumeSetSuccess(t *testing.T) { assert.Equal(t, newsize, r.GetVolume().GetSpec().GetSize()) // Send HA request - res = driverclient.Set(context.TODO(), id, nil, &api.VolumeSpec{ - HaLevel: 2, - ReplicaSet: &api.ReplicaSet{Nodes: []string{}}, - SnapshotInterval: math.MaxUint32, - }) + res = driverclient.Set(id, + nil, + &api.VolumeSpec{ + HaLevel: 2, + ReplicaSet: &api.ReplicaSet{Nodes: []string{}}, + SnapshotInterval: math.MaxUint32, + }) assert.Nil(t, res, fmt.Sprintf("Error: %v", res)) // Assert volume information is correct @@ -881,7 +883,7 @@ func TestVolumeSetFailed(t *testing.T) { Spec: &api.VolumeSpec{Size: size, HaLevel: halevel}, } // Cannot get this to fail.... - err = driverclient.Set(context.TODO(), "doesnotexist", req2.GetLocator(), req2.GetSpec()) + err = driverclient.Set("doesnotexist", req2.GetLocator(), req2.GetSpec()) // assert.NotNil(t, err) // Assert volume information is correct @@ -926,7 +928,7 @@ func TestMiddlewareVolumeSetSizeSuccess(t *testing.T) { // Not setting mock secrets - err = driverclient.Set(context.TODO(), id, nil, req.GetSpec()) + err = driverclient.Set(id, nil, req.GetSpec()) assert.NoError(t, err, "Unexpected error on Set") // Assert volume information is correct @@ -973,7 +975,7 @@ func TestMiddlewareVolumeSetFailure(t *testing.T) { // Not setting mock secrets - err = driverclient.Set(context.TODO(), id, &api.VolumeLocator{Name: "myvol"}, req.GetSpec()) + err = driverclient.Set(id, &api.VolumeLocator{Name: "myvol"}, req.GetSpec()) assert.Error(t, err, "Unexpected error on Set") } diff --git a/csi/controller_test.go b/csi/controller_test.go index cbdde5c2d..6f9284bf9 100644 --- a/csi/controller_test.go +++ b/csi/controller_test.go @@ -1947,7 +1947,7 @@ func TestControllerCreateVolumeFromSnapshot(t *testing.T) { s.MockDriver(). EXPECT(). - Set(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Set(gomock.Any(), gomock.Any(), gomock.Any()). Return(nil). Times(1), @@ -2084,7 +2084,7 @@ func TestControllerCreateVolumeSnapshotThroughParameters(t *testing.T) { Times(1), s.MockDriver(). EXPECT(). - Set(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Set(gomock.Any(), gomock.Any(), gomock.Any()). Return(nil). Times(1), // final inspect @@ -2742,7 +2742,7 @@ func TestControllerExpandVolume(t *testing.T) { AnyTimes(), s.MockDriver(). EXPECT(). - Set(gomock.Any(), gomock.Any(), gomock.Any(), &api.VolumeSpec{ + Set(gomock.Any(), gomock.Any(), &api.VolumeSpec{ Size: 46 * units.GiB, // Round up from 45.5 to 46 SnapshotInterval: math.MaxUint32, }). diff --git a/go.mod b/go.mod deleted file mode 100644 index 60eb6e379..000000000 --- a/go.mod +++ /dev/null @@ -1,186 +0,0 @@ -module github.com/libopenstorage/openstorage - -go 1.17 - -require ( - bazil.org/fuse v0.0.0-20160317181031-37bfa8be9291 - github.com/aws/aws-sdk-go v1.35.24 - github.com/cenkalti/backoff v2.2.1+incompatible - github.com/codegangsta/cli v1.13.1-0.20160326223947-bc465becccd1 - github.com/container-storage-interface/spec v1.7.0 - github.com/coreos/go-oidc v2.2.1+incompatible - github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible - github.com/dustin/go-humanize v1.0.0 - github.com/gobuffalo/packr v1.30.1 - github.com/golang-jwt/jwt/v4 v4.3.0 - github.com/golang/mock v1.6.0 - github.com/golang/protobuf v1.5.2 - github.com/google/uuid v1.3.0 - github.com/gorilla/mux v1.8.0 - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 - github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/johannesboyne/gofakes3 v0.0.0-20210819161434-5c8dfcfe5310 - github.com/kubernetes-csi/csi-test v2.2.0+incompatible - github.com/libopenstorage/gossip v0.0.0-20220309192431-44c895e0923e - github.com/libopenstorage/secrets v0.0.0-20200207034622-cdb443738c67 - github.com/libopenstorage/systemutils v0.0.0-20160208220149-44ac83be3ce1 - github.com/moby/sys/mountinfo v0.4.0 - github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.16.0 - github.com/pborman/uuid v1.2.1 - github.com/pkg/errors v0.9.1 - github.com/portworx/kvdb v0.0.0-20230326003017-21a38cf82d4b - github.com/portworx/sched-ops v1.20.4-rc1 - github.com/prometheus/client_golang v1.14.0 - github.com/rs/cors v1.6.1-0.20190116175910-76f58f330d76 - github.com/sirupsen/logrus v1.9.0 - github.com/stretchr/testify v1.8.2 - github.com/urfave/negroni v1.0.1-0.20181201104632-7183f09c600e - golang.org/x/net v0.0.0-20220225172249-27dd8689420f - golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f - golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab - google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6 - google.golang.org/grpc v1.40.0 - google.golang.org/protobuf v1.28.1 - gopkg.in/freddierice/go-losetup.v1 v1.0.0-20170407175016-fc9adea44124 - gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.20.4 - k8s.io/apimachinery v0.20.4 - k8s.io/client-go v12.0.0+incompatible - sigs.k8s.io/container-object-storage-interface-spec v0.0.0-20220211001052-50e143052de8 -) - -require ( - github.com/Microsoft/go-winio v0.4.15 // indirect - github.com/Microsoft/hcsshim v0.8.10-0.20200715222032-5eafd1556990 // indirect - github.com/armon/go-metrics v0.3.3 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/cloudfoundry/gosigar v1.3.3 // indirect - github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 // indirect - github.com/containerd/containerd v1.4.1 // indirect - github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc // indirect - github.com/coreos/etcd v3.3.13+incompatible // indirect - github.com/coreos/go-semver v0.3.0 // indirect - github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect - github.com/coreos/go-systemd/v22 v22.1.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dgrijalva/jwt-go v3.2.1-0.20180719211823-0b96aaa70776+incompatible // indirect - github.com/docker/distribution v2.7.1+incompatible // indirect - github.com/docker/go-connections v0.4.0 // indirect - github.com/docker/go-units v0.4.0 // indirect - github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c // indirect - github.com/fsnotify/fsnotify v1.5.1 // indirect - github.com/go-logr/logr v1.1.0 // indirect - github.com/gobuffalo/envy v1.7.0 // indirect - github.com/gobuffalo/packd v0.3.0 // indirect - github.com/godbus/dbus/v5 v5.0.3 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect - github.com/google/btree v1.0.0 // indirect - github.com/google/gofuzz v1.1.0 // indirect - github.com/googleapis/gnostic v0.5.1 // indirect - github.com/hashicorp/consul/api v1.3.0 // indirect - github.com/hashicorp/errwrap v1.0.0 // indirect - github.com/hashicorp/go-cleanhttp v0.5.1 // indirect - github.com/hashicorp/go-immutable-radix v1.2.0 // indirect - github.com/hashicorp/go-msgpack v0.5.5 // indirect - github.com/hashicorp/go-multierror v1.0.0 // indirect - github.com/hashicorp/go-rootcerts v1.0.0 // indirect - github.com/hashicorp/go-sockaddr v1.0.2 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/memberlist v0.1.4 // indirect - github.com/hashicorp/serf v0.8.2 // indirect - github.com/imdario/mergo v0.3.10 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/joho/godotenv v1.3.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/kr/pretty v0.2.1 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/miekg/dns v1.1.35 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/mapstructure v1.3.3 // indirect - github.com/moby/locker v1.0.1 // indirect - github.com/moby/sys/mount v0.2.0 // indirect - github.com/moby/sys/symlink v0.1.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/nxadm/tail v1.4.8 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.0.1 // indirect - github.com/opencontainers/runc v1.0.0-rc92 // indirect - github.com/opencontainers/runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6 // indirect - github.com/opencontainers/selinux v1.6.0 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect - github.com/rogpeppe/go-internal v1.3.0 // indirect - github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect - github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect - github.com/shabbyrobe/gocovmerge v0.0.0-20180507124511-f6ea450bfb63 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 // indirect - github.com/vbatts/tar-split v0.9.14-0.20160330203851-226f7c74905f // indirect - github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243 // indirect - go.opencensus.io v0.22.4 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/zap v1.15.0 // indirect - golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 // indirect - golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect - golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect - golang.org/x/tools v0.1.5 // indirect - google.golang.org/appengine v1.6.7 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/square/go-jose.v2 v2.3.1 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.20.0 // indirect - k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd // indirect - k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.0.2 // indirect - sigs.k8s.io/yaml v1.2.0 // indirect -) - -replace ( - github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.44.24 - github.com/docker/docker => github.com/moby/moby v20.10.3-0.20210324213045-797b974cb90e+incompatible - github.com/kubernetes-incubator/external-storage => github.com/libopenstorage/external-storage v0.20.4-openstorage-rc3 - github.com/satori/go.uuid => github.com/satori/go.uuid v0.0.0-20160324112244-f9ab0dce87d8 - - google.golang.org/grpc => google.golang.org/grpc v1.29.1 - - // Replacing k8s.io dependencies is required if a dependency or any dependency of a dependency - // depends on k8s.io/kubernetes. See https://github.com/kubernetes/kubernetes/issues/79384#issuecomment-505725449 - k8s.io/api => k8s.io/api v0.20.4 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.20.4 - k8s.io/apimachinery => k8s.io/apimachinery v0.20.4 - k8s.io/apiserver => k8s.io/apiserver v0.20.4 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.20.4 - k8s.io/client-go => k8s.io/client-go v0.20.4 - k8s.io/cloud-provider => k8s.io/cloud-provider v0.20.4 - k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.20.4 - k8s.io/code-generator => k8s.io/code-generator v0.20.4 - k8s.io/component-base => k8s.io/component-base v0.20.4 - k8s.io/component-helpers => k8s.io/component-helpers v0.20.4 - k8s.io/controller-manager => k8s.io/controller-manager v0.20.4 - k8s.io/cri-api => k8s.io/cri-api v0.20.4 - k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.20.4 - k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.20.4 - k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.20.4 - k8s.io/kube-proxy => k8s.io/kube-proxy v0.20.4 - k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.20.4 - k8s.io/kubectl => k8s.io/kubectl v0.20.4 - k8s.io/kubelet => k8s.io/kubelet v0.20.4 - k8s.io/kubernetes => k8s.io/kubernetes v1.20.4 - k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.20.4 - k8s.io/metrics => k8s.io/metrics v0.20.4 - k8s.io/mount-utils => k8s.io/mount-utils v0.20.4 - k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.20.4 -) diff --git a/pkg/sanity/volume.go b/pkg/sanity/volume.go index e923bdd81..6227dfaf4 100644 --- a/pkg/sanity/volume.go +++ b/pkg/sanity/volume.go @@ -617,7 +617,7 @@ var _ = Describe("Volume [Volume Tests]", func() { }, } - err = volumedriver.Set(context.TODO(), volumeID, set.GetLocator(), set.GetSpec()) + err = volumedriver.Set(volumeID, set.GetLocator(), set.GetSpec()) Expect(err).NotTo(HaveOccurred()) By("Inspecting the volume for new updates") @@ -679,7 +679,7 @@ var _ = Describe("Volume [Volume Tests]", func() { }, } - err = volumedriver.Set(context.TODO(), volumeID, set.Locator, set.Spec) + err = volumedriver.Set(volumeID, set.Locator, set.Spec) Expect(err).NotTo(HaveOccurred()) By("Inspecting the volume for new updates") diff --git a/volume/drivers/buse/buse.go b/volume/drivers/buse/buse.go index 0ede24928..eb7ef4bc4 100644 --- a/volume/drivers/buse/buse.go +++ b/volume/drivers/buse/buse.go @@ -360,7 +360,7 @@ func (d *driver) SnapshotGroup(groupID string, labels map[string]string, volumeI return nil, volume.ErrNotSupported } -func (d *driver) Set(ctx context.Context, volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error { +func (d *driver) Set(volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error { if spec != nil { return volume.ErrNotSupported } diff --git a/volume/drivers/fake/fake.go b/volume/drivers/fake/fake.go index 98a4d29b8..ef3b75121 100644 --- a/volume/drivers/fake/fake.go +++ b/volume/drivers/fake/fake.go @@ -335,7 +335,7 @@ func (d *driver) CloudMigrateStatus(request *api.CloudMigrateStatusRequest) (*ap }, nil } -func (d *driver) Set(ctx context.Context, volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error { +func (d *driver) Set(volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error { v, err := d.GetVol(volumeID) if err != nil { return err diff --git a/volume/drivers/fake/fake_test.go b/volume/drivers/fake/fake_test.go index af013c5bc..fcb47cbb6 100644 --- a/volume/drivers/fake/fake_test.go +++ b/volume/drivers/fake/fake_test.go @@ -715,7 +715,7 @@ func TestFakeSet(t *testing.T) { assert.NotEmpty(t, volid) // Set values - err = d.Set(context.TODO(), volid, &api.VolumeLocator{ + err = d.Set(volid, &api.VolumeLocator{ Name: "newname", VolumeLabels: map[string]string{ "hello": "world", diff --git a/volume/drivers/fuse/volume_driver.go b/volume/drivers/fuse/volume_driver.go index 081382e2e..104f468b3 100644 --- a/volume/drivers/fuse/volume_driver.go +++ b/volume/drivers/fuse/volume_driver.go @@ -178,7 +178,7 @@ func (v *volumeDriver) Unmount(ctx context.Context, volumeID string, mountpath s return v.UpdateVol(volume) } -func (v *volumeDriver) Set(ctx context.Context, volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error { +func (v *volumeDriver) Set(volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error { return volume.ErrNotSupported } diff --git a/volume/drivers/mock/driver.mock.go b/volume/drivers/mock/driver.mock.go index 25f49b00a..3892678f1 100644 --- a/volume/drivers/mock/driver.mock.go +++ b/volume/drivers/mock/driver.mock.go @@ -810,18 +810,18 @@ func (mr *MockVolumeDriverMockRecorder) Restore(arg0, arg1 interface{}) *gomock. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Restore", reflect.TypeOf((*MockVolumeDriver)(nil).Restore), arg0, arg1) } -// Set mocks base method. -func (m *MockVolumeDriver) Set(arg0 context.Context, arg1 string, arg2 *api.VolumeLocator, arg3 *api.VolumeSpec) error { +// Set mocks base method +func (m *MockVolumeDriver) Set(arg0 string, arg1 *api.VolumeLocator, arg2 *api.VolumeSpec) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Set", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "Set", arg0, arg1, arg2) ret0, _ := ret[0].(error) return ret0 } -// Set indicates an expected call of Set. -func (mr *MockVolumeDriverMockRecorder) Set(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +// Set indicates an expected call of Set +func (mr *MockVolumeDriverMockRecorder) Set(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockVolumeDriver)(nil).Set), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockVolumeDriver)(nil).Set), arg0, arg1, arg2) } // Shutdown mocks base method diff --git a/volume/drivers/nfs/nfs.go b/volume/drivers/nfs/nfs.go index 5136a618f..5422917e2 100644 --- a/volume/drivers/nfs/nfs.go +++ b/volume/drivers/nfs/nfs.go @@ -787,7 +787,7 @@ func (d *driver) Detach(ctx context.Context, volumeID string, options map[string return nil } -func (d *driver) Set(ctx context.Context, volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error { +func (d *driver) Set(volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error { if spec != nil { return volume.ErrNotSupported } diff --git a/volume/drivers/test/driver.go b/volume/drivers/test/driver.go index 5e867b402..3b2aa4b3c 100644 --- a/volume/drivers/test/driver.go +++ b/volume/drivers/test/driver.go @@ -149,7 +149,7 @@ func set(t *testing.T, ctx *Context) { require.Equal(t, vols[0].Id, ctx.volID, "Expect volID %v actual %v", ctx.volID, vols[0].Id) vols[0].Locator.VolumeLabels["UpdateTest"] = "Success" - err = ctx.Set(correlation.TODO(), ctx.volID, vols[0].Locator, nil) + err = ctx.Set(ctx.volID, vols[0].Locator, nil) if err != volume.ErrNotSupported { require.NoError(t, err, "Failed in Update") vols, err = ctx.Inspect(correlation.TODO(), []string{ctx.volID}) diff --git a/volume/drivers/vfs/vfs.go b/volume/drivers/vfs/vfs.go index c8f7f2ed4..267c3cdc6 100644 --- a/volume/drivers/vfs/vfs.go +++ b/volume/drivers/vfs/vfs.go @@ -169,7 +169,7 @@ func (d *driver) Unmount(ctx context.Context, volumeID string, mountpath string, return d.UpdateVol(v) } -func (d *driver) Set(ctx context.Context, volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error { +func (d *driver) Set(volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error { if spec != nil { return volume.ErrNotSupported } diff --git a/volume/volume.go b/volume/volume.go index a18f0e4c5..e0b0572a8 100644 --- a/volume/volume.go +++ b/volume/volume.go @@ -281,7 +281,7 @@ type ProtoDriver interface { Unmount(ctx context.Context, volumeID string, mountPath string, options map[string]string) error // Update not all fields of the spec are supported, ErrNotSupported will be thrown for unsupported // updates. - Set(ctx context.Context, volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error + Set(volumeID string, locator *api.VolumeLocator, spec *api.VolumeSpec) error // Status returns a set of key-value pairs which give low // level diagnostic status about this driver. Status() [][2]string