Skip to content

Commit

Permalink
Expose VSC SourceVolumeMode
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Fruchtman <[email protected]>

Add changelog and unittest
  • Loading branch information
msfrucht committed Oct 3, 2024
1 parent 42de654 commit 58d8e5a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/8260-msfrucht
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Expose VSC SourceVolumeMode
1 change: 1 addition & 0 deletions pkg/exposer/csi_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ func (e *csiSnapshotExposer) createBackupVSC(ctx context.Context, ownerObject co
DeletionPolicy: snapshotv1api.VolumeSnapshotContentDelete,
Driver: snapshotVSC.Spec.Driver,
VolumeSnapshotClassName: snapshotVSC.Spec.VolumeSnapshotClassName,
SourceVolumeMode: snapshotVSC.Spec.SourceVolumeMode,
},
}

Expand Down
1 change: 1 addition & 0 deletions pkg/exposer/csi_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ func TestExpose(t *testing.T) {
assert.Equal(t, expectedVSC.Spec.DeletionPolicy, vscObj.Spec.DeletionPolicy)
assert.Equal(t, expectedVSC.Spec.Driver, vscObj.Spec.Driver)
assert.Equal(t, *expectedVSC.Spec.VolumeSnapshotClassName, *vscObj.Spec.VolumeSnapshotClassName)
assert.Equal(t, *expectedVSC.Spec.SourceVolumeMode, *vscObj.Spec.SourceVolumeMode)

if test.expectedVolumeSize != nil {
assert.Equal(t, *test.expectedVolumeSize, backupPVC.Spec.Resources.Requests[corev1.ResourceStorage])
Expand Down

0 comments on commit 58d8e5a

Please sign in to comment.