From 0c2d419467d8f29c8efead8ad7c47f68c91acf13 Mon Sep 17 00:00:00 2001 From: akorotkov Date: Sun, 27 Oct 2024 09:51:30 +0200 Subject: [PATCH] remove check on backup --- pkg/service/aerospike_service.go | 16 ---------------- pkg/service/backup_go.go | 8 -------- 2 files changed, 24 deletions(-) diff --git a/pkg/service/aerospike_service.go b/pkg/service/aerospike_service.go index 4ca89bf3..352a1a76 100644 --- a/pkg/service/aerospike_service.go +++ b/pkg/service/aerospike_service.go @@ -83,22 +83,6 @@ func filterRoutinesByCluster( return filteredRoutines } -// clusterHasRequiredNamespace checks if given namespace exists in cluster. -func clusterHasRequiredNamespace(namespace string, client backup.AerospikeClient) (bool, error) { - namespacesInCluster, err := getAllNamespacesOfCluster(client) - if err != nil { - return false, fmt.Errorf("failed to retrieve namespaces from cluster: %w", err) - } - - for _, n := range namespacesInCluster { - if n == namespace { - return true, nil - } - } - - return false, nil -} - // getAllNamespacesOfCluster retrieves a list of all namespaces in an Aerospike cluster. func getAllNamespacesOfCluster(client backup.AerospikeClient) ([]string, error) { node, err := client.Cluster().GetRandomNode() diff --git a/pkg/service/backup_go.go b/pkg/service/backup_go.go index 0e7a4f68..371317c2 100644 --- a/pkg/service/backup_go.go +++ b/pkg/service/backup_go.go @@ -33,14 +33,6 @@ func (b *BackupGo) BackupRun( namespace string, path string, ) (BackupHandler, error) { - ok, err := clusterHasRequiredNamespace(namespace, client.AerospikeClient()) - if err != nil { - return nil, err - } - if !ok { - return nil, fmt.Errorf("cluster does not have the namespace %s configured", namespace) - } - config := makeBackupConfig(namespace, backupRoutine, backupPolicy, timebounds, secretAgent) writerFactory, err := storage.CreateWriter(ctx, s, path, false,