func pvHookActionRemove(obj *corev1.PersistentVolume, hookCfg PVHook) {
	if len(hookCfg.Annotations) != 0 {
		helper.RemoveAnnotations(&obj.ObjectMeta, hookCfg.Annotations)
	}
	if len(hookCfg.Finalizers) != 0 {
		helper.RemoveFinalizers(&obj.ObjectMeta, hookCfg.Finalizers)
	}
	return
}
pvHookActionRemove will remove the given hook config to the given object
package hook
import (
	"github.com/openebs/dynamic-nfs-provisioner/pkg/helper"
	"github.com/pkg/errors"
	corev1 "k8s.io/api/core/v1"
)
func pvHookAction(hookCfg *PVHook, action ActionOp, obj interface{}) error {
	if hookCfg == nil {
		return nil
	}
	pvObj, ok := obj.(*corev1.PersistentVolume)
	if !ok {
		return errors.Errorf("%T is not a PersistentVolume type", obj)
	}
	switch action {
	case ActionOpAddOrUpdate:
		pvHookActionAdd(pvObj, *hookCfg)
	case ActionOpRemove:
		pvHookActionRemove(pvObj, *hookCfg)
	}
	return nil
}
func pvHookActionAdd(obj *corev1.PersistentVolume, hookCfg PVHook) {
	if len(hookCfg.Annotations) != 0 {
		AddAnnotations(&obj.ObjectMeta, hookCfg.Annotations)
	}
	if len(hookCfg.Finalizers) != 0 {
		helper.AddFinalizers(&obj.ObjectMeta, hookCfg.Finalizers)
	}
	return
}