vendor: update compose-go to v2.0.2

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2024-04-09 09:20:12 +02:00
parent e7f2da9c4f
commit ca0b583f5a
16 changed files with 530 additions and 438 deletions

View File

@ -44,7 +44,7 @@ var patternString = fmt.Sprintf(
groupInvalid,
)
var defaultPattern = regexp.MustCompile(patternString)
var DefaultPattern = regexp.MustCompile(patternString)
// InvalidTemplateError is returned when a variable template is not in a valid
// format
@ -121,7 +121,7 @@ func SubstituteWithOptions(template string, mapping Mapping, options ...Option)
var returnErr error
cfg := &Config{
pattern: defaultPattern,
pattern: DefaultPattern,
replacementFunc: DefaultReplacementFunc,
logging: true,
}
@ -268,14 +268,14 @@ func getFirstBraceClosingIndex(s string) int {
// Substitute variables in the string with their values
func Substitute(template string, mapping Mapping) (string, error) {
return SubstituteWith(template, mapping, defaultPattern)
return SubstituteWith(template, mapping, DefaultPattern)
}
// ExtractVariables returns a map of all the variables defined in the specified
// composefile (dict representation) and their default value if any.
func ExtractVariables(configDict map[string]interface{}, pattern *regexp.Regexp) map[string]Variable {
if pattern == nil {
pattern = defaultPattern
pattern = DefaultPattern
}
return recurseExtract(configDict, pattern)
}