mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-25 17:34:17 +00:00
Check whether the action is a CSI action and whether CSI feature is
enabled, before executing the action. The DeleteItemAction is not checked, because the DIA doesn't have a method to get the action's plugin name. This should be OK, because the CSI will check whether the VS and VSC have a backup name annotation. If the VS and VSC is not handled by the CSI plugin, then they don't have the annotation. Signed-off-by: Xun Jiang <jxun@vmware.com>
This commit is contained in:
@@ -73,6 +73,7 @@ import (
|
||||
"github.com/vmware-tanzu/velero/pkg/persistence"
|
||||
"github.com/vmware-tanzu/velero/pkg/plugin/clientmgmt"
|
||||
"github.com/vmware-tanzu/velero/pkg/plugin/clientmgmt/process"
|
||||
"github.com/vmware-tanzu/velero/pkg/plugin/framework/common"
|
||||
"github.com/vmware-tanzu/velero/pkg/podexec"
|
||||
"github.com/vmware-tanzu/velero/pkg/podvolume"
|
||||
"github.com/vmware-tanzu/velero/pkg/repository"
|
||||
@@ -309,6 +310,13 @@ func newServer(f client.Factory, config serverConfig, logger *logrus.Logger) (*s
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !features.IsEnabled(velerov1api.CSIFeatureFlag) {
|
||||
_, err = pluginRegistry.Get(common.PluginKindBackupItemActionV2, "velero.io/csi-pvc-backupper")
|
||||
if err == nil {
|
||||
logger.Warn("CSI plugins are registered, but the EnableCSI feature is not enabled.")
|
||||
}
|
||||
}
|
||||
|
||||
// cancelFunc is not deferred here because if it was, then ctx would immediately
|
||||
// be canceled once this function exited, making it useless to any informers using later.
|
||||
// That, in turn, causes the velero server to halt when the first informer tries to use it.
|
||||
|
||||
Reference in New Issue
Block a user