mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-04-22 00:30:34 +00:00
Avoid duplicated snapshotting, when CSI is enabled
Fix #4758 Do not take snapshot for PV to avoid duplicated snapshotting, when CSI feature is enabled. Signed-off-by: Xun Jiang <jxun@vmware.com>
This commit is contained in:
1
changelogs/unreleased/4797-jxun
Normal file
1
changelogs/unreleased/4797-jxun
Normal file
@@ -0,0 +1 @@
|
||||
Do not take snapshot for PV to avoid duplicated snapshotting, when CSI feature is enabled.
|
||||
@@ -39,6 +39,7 @@ import (
|
||||
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
|
||||
"github.com/vmware-tanzu/velero/pkg/client"
|
||||
"github.com/vmware-tanzu/velero/pkg/discovery"
|
||||
"github.com/vmware-tanzu/velero/pkg/features"
|
||||
"github.com/vmware-tanzu/velero/pkg/kuberesource"
|
||||
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
|
||||
"github.com/vmware-tanzu/velero/pkg/restic"
|
||||
@@ -415,6 +416,12 @@ func (ib *itemBackupper) takePVSnapshot(obj runtime.Unstructured, log logrus.Fie
|
||||
}
|
||||
}
|
||||
|
||||
// #4758 Do not take snapshot for CSI PV to avoid duplicated snapshotting, when CSI feature is enabled.
|
||||
if features.IsEnabled(velerov1api.CSIFeatureFlag) && pv.Spec.CSI != nil {
|
||||
log.Infof("Skipping snapshot of persistent volume %s, because it's handled by CSI plugin.", pv.Name)
|
||||
return nil
|
||||
}
|
||||
|
||||
// TODO: -- once failure-domain.beta.kubernetes.io/zone is no longer
|
||||
// supported in any velero-supported version of Kubernetes, remove fallback checking of it
|
||||
pvFailureDomainZone, labelFound := pv.Labels[zoneLabel]
|
||||
|
||||
Reference in New Issue
Block a user