From f678c150bfd3cb424a8f4cde180b3b14ea9f6936 Mon Sep 17 00:00:00 2001 From: Adam Krpan Date: Tue, 20 Aug 2024 22:59:38 +0000 Subject: [PATCH] PWX-38585: PR feedback Signed-off-by: Adam Krpan --- csi/controller.go | 3 --- csi/controller_test.go | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) 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).