Skip to content

Commit

Permalink
remove check on backup
Browse files Browse the repository at this point in the history
  • Loading branch information
korotkov-aerospike committed Oct 27, 2024
1 parent 5b58800 commit 0c2d419
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
16 changes: 0 additions & 16 deletions pkg/service/aerospike_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 0 additions & 8 deletions pkg/service/backup_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0c2d419

Please sign in to comment.