Skip to content

Commit c497961

Browse files
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.
1 parent 7f982f0 commit c497961

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/service/backup/service.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,12 @@ func GetRetention(taskID uuid.UUID, retentionMap RetentionMap) RetentionPolicy {
112112
}
113113

114114
// GetTarget converts runner properties into backup Target.
115-
// It also ensures configuration for the backup providers is registered on the
116-
// targeted hosts.
115+
// It also ensures configuration for the backup providers is registered on the targeted hosts.
117116
func (s *Service) GetTarget(ctx context.Context, clusterID uuid.UUID, properties json.RawMessage) (Target, error) {
117+
return s.targetFromProperties(ctx, clusterID, properties)
118+
}
119+
120+
func (s *Service) targetFromProperties(ctx context.Context, clusterID uuid.UUID, properties json.RawMessage) (Target, error) {
118121
s.logger.Info(ctx, "Generating backup target", "cluster_id", clusterID)
119122

120123
p := defaultTaskProperties()

0 commit comments

Comments
 (0)