Skip to content

Commit

Permalink
clean up debugging content
Browse files Browse the repository at this point in the history
Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed Feb 26, 2024
1 parent 6740b07 commit 84e574f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
3 changes: 0 additions & 3 deletions pkg/common-controller/framework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1299,16 +1299,13 @@ func testSyncContentError(ctrl *csiSnapshotCommonController, reactor *snapshotRe
}

func testAddPVCFinalizer(ctrl *csiSnapshotCommonController, reactor *snapshotReactor, test controllerTest) error {
thisTestVolumeSnapshot = test.initialSnapshots[0]
return ctrl.ensurePVCFinalizer(test.initialSnapshots[0])
}

func testRemovePVCFinalizer(ctrl *csiSnapshotCommonController, reactor *snapshotReactor, test controllerTest) error {
return ctrl.checkandRemovePVCFinalizer(test.initialSnapshots[0], false)
}
var thisTestVolumeSnapshot *crdv1.VolumeSnapshot
func testAddSnapshotFinalizer(ctrl *csiSnapshotCommonController, reactor *snapshotReactor, test controllerTest) error {
thisTestVolumeSnapshot = test.initialSnapshots[0]
return ctrl.addSnapshotFinalizer(test.initialSnapshots[0], true, true)
}

Expand Down
11 changes: 0 additions & 11 deletions pkg/common-controller/snapshot_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1506,23 +1506,12 @@ func (ctrl *csiSnapshotCommonController) addSnapshotFinalizer(snapshot *crdv1.Vo
var updatedSnapshot *crdv1.VolumeSnapshot
var err error

// var patches []utils.PatchOp
finalizersToAdd := []string{}
// If finalizers exist already, add new ones to the end of the array
if addSourceFinalizer {
// patches = append(patches, utils.PatchOp{
// Op: "add",
// Path: "/metadata/finalizers/-",
// Value: utils.VolumeSnapshotAsSourceFinalizer,
// })
finalizersToAdd = append(finalizersToAdd, utils.VolumeSnapshotAsSourceFinalizer)
}
if addBoundFinalizer {
// patches = append(patches, utils.PatchOp{
// Op: "add",
// Path: "/metadata/finalizers/-",
// Value: utils.VolumeSnapshotBoundFinalizer,
// })
finalizersToAdd = append(finalizersToAdd, utils.VolumeSnapshotBoundFinalizer)
}
patches := utils.PatchOpsToAddFinalizers(snapshot, finalizersToAdd...)
Expand Down

0 comments on commit 84e574f

Please sign in to comment.