Skip to content

Commit 31f4751

Browse files
authored
cinder csi: fix double snapshots package import (kubernetes#2135)
1 parent 5eec1e7 commit 31f4751

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/csi/cinder/controllerserver.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222

2323
"github.com/container-storage-interface/spec/lib/go/csi"
2424
"github.com/gophercloud/gophercloud/openstack/blockstorage/v3/snapshots"
25-
ossnapshots "github.com/gophercloud/gophercloud/openstack/blockstorage/v3/snapshots"
2625
"github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes"
2726
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"
2827
"golang.org/x/net/context"
@@ -338,14 +337,14 @@ func (cs *controllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateS
338337
}
339338

340339
// Verify a snapshot with the provided name doesn't already exist for this tenant
340+
var snap *snapshots.Snapshot
341341
filters := map[string]string{}
342342
filters["Name"] = name
343343
snapshots, _, err := cs.Cloud.ListSnapshots(filters)
344344
if err != nil {
345345
klog.Errorf("Failed to query for existing Snapshot during CreateSnapshot: %v", err)
346346
return nil, status.Error(codes.Internal, "Failed to get snapshots")
347347
}
348-
var snap *ossnapshots.Snapshot
349348

350349
if len(snapshots) == 1 {
351350
snap = &snapshots[0]

0 commit comments

Comments
 (0)