chore: remove unused parameter from util funcs; add unit test
Added the unit tests from https://github.com/kubernetes/kubernetes/blob/master/pkg/util/slice/slice_test.go (minus modifier tests) so we can be sure to not change behaviour.
This commit is contained in:
@@ -505,12 +505,12 @@ func (ctrl *csiSnapshotSideCarController) GetCredentialsFromAnnotation(content *
|
||||
// removeContentFinalizer removes the VolumeSnapshotContentFinalizer from a
|
||||
// content if there exists one.
|
||||
func (ctrl csiSnapshotSideCarController) removeContentFinalizer(content *crdv1.VolumeSnapshotContent) error {
|
||||
if !utils.ContainsString(content.ObjectMeta.Finalizers, utils.VolumeSnapshotContentFinalizer, nil) {
|
||||
if !utils.ContainsString(content.ObjectMeta.Finalizers, utils.VolumeSnapshotContentFinalizer) {
|
||||
// the finalizer does not exit, return directly
|
||||
return nil
|
||||
}
|
||||
contentClone := content.DeepCopy()
|
||||
contentClone.ObjectMeta.Finalizers = utils.RemoveString(contentClone.ObjectMeta.Finalizers, utils.VolumeSnapshotContentFinalizer, nil)
|
||||
contentClone.ObjectMeta.Finalizers = utils.RemoveString(contentClone.ObjectMeta.Finalizers, utils.VolumeSnapshotContentFinalizer)
|
||||
|
||||
_, err := ctrl.clientset.SnapshotV1beta1().VolumeSnapshotContents().Update(context.TODO(), contentClone, metav1.UpdateOptions{})
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user