Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lennartkats-db committed Jun 14, 2024
1 parent 405e202 commit 7323d02
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions bundle/config/mutator/apply_transforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@ func (m *applyTransforms) Name() string {
return "ApplyTransforms"
}

func validatePauseStatus(b *bundle.Bundle) diag.Diagnostics {
p := b.Config.Transform.DefaultTriggerPauseStatus
if p == "" || p == config.Paused || p == config.Unpaused {
return nil
}
return diag.Diagnostics{{
Summary: "Invalid value for default_trigger_pause_status, should be PAUSED or UNPAUSED",
Severity: diag.Error,
Location: b.Config.GetLocation("transform.default_trigger_pause_status"),
}}
}

func (m *applyTransforms) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnostics {
diag := validatePauseStatus(b)
if diag != nil {
Expand Down Expand Up @@ -154,6 +142,18 @@ func (m *applyTransforms) Apply(ctx context.Context, b *bundle.Bundle) diag.Diag
return nil
}

func validatePauseStatus(b *bundle.Bundle) diag.Diagnostics {
p := b.Config.Transform.DefaultTriggerPauseStatus
if p == "" || p == config.Paused || p == config.Unpaused {
return nil
}
return diag.Diagnostics{{
Summary: "Invalid value for default_trigger_pause_status, should be PAUSED or UNPAUSED",
Severity: diag.Error,
Location: b.Config.GetLocation("transform.default_trigger_pause_status"),
}}
}

// Convert a map of tags to an array of tags.
// We sort tags so we always produce a consistent list of tags.
func toTagArray(tags *map[string]string) []Tag {
Expand Down

0 comments on commit 7323d02

Please sign in to comment.