diff --git a/csi/controller.go b/csi/controller.go index 5970090d5..a4fb999fb 100644 --- a/csi/controller.go +++ b/csi/controller.go @@ -618,9 +618,6 @@ func (s *OsdCsiServer) CreateVolume( if spec.GetFADAPodName() != "" { labels[api.SpecPurePodName] = spec.GetFADAPodName() } - delete(labels, intreePvcNameKey) - delete(labels, intreePvcNamespaceKey) - delete(labels, api.SpecParent) cloneResp, err := volumes.Clone(ctx, &api.SdkVolumeCloneRequest{ Name: req.GetName(), ParentId: source.Parent, diff --git a/csi/controller_test.go b/csi/controller_test.go index e7c9d7713..5e3e89c00 100644 --- a/csi/controller_test.go +++ b/csi/controller_test.go @@ -1333,7 +1333,7 @@ func TestControllerCreateVolumeBadSnapshot(t *testing.T) { // Return an error from snapshot s.MockDriver(). EXPECT(). - Snapshot(gomock.Any(), parent, false, &api.VolumeLocator{Name: name, VolumeLabels: nil}, false). + Snapshot(gomock.Any(), parent, false, &api.VolumeLocator{Name: name, VolumeLabels: map[string]string{api.SpecParent: parent}}, false). Return("", fmt.Errorf("snapshoterr")). Times(1), ) @@ -2163,7 +2163,8 @@ func TestControllerCreateVolumeSnapshotThroughParameters(t *testing.T) { s.MockDriver(). EXPECT(). Snapshot(gomock.Any(), mockParentID, false, &api.VolumeLocator{ - Name: name, + Name: name, + VolumeLabels: map[string]string{api.SpecParent: mockParentID}, }, false). Return(id, nil).