From 1384fbc4fc07ffb44f817e774ecc5dbd09e98f2b Mon Sep 17 00:00:00 2001 From: Aditya Dani Date: Mon, 20 Dec 2021 14:58:12 -0800 Subject: [PATCH] Fix getDriverType() function - We don't need to check for the src and dest fields if the driver type is rsync. --- pkg/controllers/dataexport/reconcile.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/controllers/dataexport/reconcile.go b/pkg/controllers/dataexport/reconcile.go index 4f95121f9..2bcf8bee8 100644 --- a/pkg/controllers/dataexport/reconcile.go +++ b/pkg/controllers/dataexport/reconcile.go @@ -1642,6 +1642,11 @@ func hasLocalRestoreStage(de *kdmpapi.DataExport) bool { } func getDriverType(de *kdmpapi.DataExport) (string, error) { + // Quick return for rsync driver + if de.Spec.Type == kdmpapi.DataExportRsync { + return string(de.Spec.Type), nil + } + // Do some extra checks for generic backups/restores src := de.Spec.Source dst := de.Spec.Destination doBackup := false @@ -1663,7 +1668,6 @@ func getDriverType(de *kdmpapi.DataExport) (string, error) { } switch de.Spec.Type { - case kdmpapi.DataExportRsync: case kdmpapi.DataExportRestic: if doBackup { return drivers.ResticBackup, nil