Skip to content

Commit

Permalink
Avoid create tag from metadata req of snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
jichenjc committed Jun 17, 2021
1 parent f88591c commit ea4c0a4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions pkg/csi/cinder/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,6 @@ func (cs *controllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateS
} else {
// Add cluster ID to the snapshot metadata
properties := map[string]string{cinderCSIClusterIDKey: cs.Driver.cluster}
for mKey, mVal := range req.Parameters {
properties[mKey] = mVal
}

// TODO: Delegate the check to openstack itself and ignore the conflict
snap, err = cs.Cloud.CreateSnapshot(name, volumeId, &properties)
Expand Down
2 changes: 1 addition & 1 deletion pkg/csi/cinder/controllerserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ func TestListVolumes(t *testing.T) {
// Test CreateSnapshot
func TestCreateSnapshot(t *testing.T) {

osmock.On("CreateSnapshot", FakeSnapshotName, FakeVolID, &map[string]string{cinderCSIClusterIDKey: "cluster", "tag": "tag1"}).Return(&FakeSnapshotRes, nil)
osmock.On("CreateSnapshot", FakeSnapshotName, FakeVolID, &map[string]string{cinderCSIClusterIDKey: "cluster"}).Return(&FakeSnapshotRes, nil)
osmock.On("ListSnapshots", map[string]string{"Name": FakeSnapshotName}).Return(FakeSnapshotListEmpty, "", nil)
osmock.On("WaitSnapshotReady", FakeSnapshotID).Return(nil)

Expand Down

0 comments on commit ea4c0a4

Please sign in to comment.