From 6f7ce86c76b46bc156fc519985d31fce166d58f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Leszczy=C5=84ski?= <2000michal@wp.pl> Date: Tue, 23 Jul 2024 11:57:28 +0200 Subject: [PATCH] refactor(backup): make GetTarget a wrapper for targetFromProperties This is to emphasise that even though the REST API interface method is called GetTarget, the actual implementation is not a simple getter. --- pkg/service/backup/service.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/service/backup/service.go b/pkg/service/backup/service.go index 910736e7e..c9b696824 100644 --- a/pkg/service/backup/service.go +++ b/pkg/service/backup/service.go @@ -112,9 +112,12 @@ func GetRetention(taskID uuid.UUID, retentionMap RetentionMap) RetentionPolicy { } // GetTarget converts runner properties into backup Target. -// It also ensures configuration for the backup providers is registered on the -// targeted hosts. +// It also ensures configuration for the backup providers is registered on the targeted hosts. func (s *Service) GetTarget(ctx context.Context, clusterID uuid.UUID, properties json.RawMessage) (Target, error) { + return s.targetFromProperties(ctx, clusterID, properties) +} + +func (s *Service) targetFromProperties(ctx context.Context, clusterID uuid.UUID, properties json.RawMessage) (Target, error) { s.logger.Info(ctx, "Generating backup target", "cluster_id", clusterID) p := defaultTaskProperties()