Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions pkg/config/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,7 @@ func (cfg Configuration) PerformVarSubstitutions(nw map[string]string) error {
return fmt.Errorf("match value: %s string does not compile into a regex: %w", v.Match, err)
}

// Check if the regex matches at all
if !re.MatchString(from) {
return fmt.Errorf("var-transform %q failed: regex %q does not match input %q (no substitution will be performed)", v.To, v.Match, from)
}

output := re.ReplaceAllString(from, v.Replace)
if output == "" {
return fmt.Errorf("var-transform %q resulted in empty value (from=%q, match=%q, replace=%q) - transformed variables cannot be empty", v.To, from, v.Match, v.Replace)
}
nw[nk] = output
}

Expand Down
156 changes: 0 additions & 156 deletions pkg/config/vars_test.go

This file was deleted.

Loading