Make Velero server continue to work, when CSI feature is enabled and Snapshot CRD group is missing.

Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
pull/6062/head
Xun Jiang 2023-03-31 17:03:32 +08:00
parent b428b09a78
commit c1acd9c6c5
2 changed files with 2 additions and 0 deletions

View File

@ -0,0 +1 @@
Make Velero not exits when EnableCSI is on and CSI snapshot not installed

View File

@ -585,6 +585,7 @@ func (s *server) getCSIVolumeSnapshotListers() (vsLister snapshotv1listers.Volum
case apierrors.IsNotFound(err):
// CSI is enabled, but the required CRDs aren't installed, so halt.
s.logger.Warnf("The '%s' feature flag was specified, but CSI API group [%s] was not found.", velerov1api.CSIFeatureFlag, snapshotv1api.SchemeGroupVersion.String())
err = nil
case err == nil:
wrapper := NewCSIInformerFactoryWrapper(s.csiSnapshotClient)