Skip to content

Commit

Permalink
refactor(backup): make GetTarget a wrapper for targetFromProperties
Browse files Browse the repository at this point in the history
This is to emphasise that even though the REST API interface method is called GetTarget, the actual implementation is not a simple getter.
  • Loading branch information
Michal-Leszczynski authored and karol-kokoszka committed Aug 9, 2024
1 parent 77e9708 commit a66c518
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/service/backup/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a66c518

Please sign in to comment.