vendor: update to compose-go 1.13.4

Signed-off-by: Nick Sieger <nick@nicksieger.com>
This commit is contained in:
Nick Sieger
2023-04-21 10:52:58 -05:00
parent afcaa8df5f
commit 956a1be656
34 changed files with 1130 additions and 770 deletions

View File

@ -47,6 +47,19 @@ func (e InvalidTemplateError) Error() string {
return fmt.Sprintf("Invalid template: %#v", e.Template)
}
// MissingRequiredError is returned when a variable template is missing
type MissingRequiredError struct {
Variable string
Reason string
}
func (e MissingRequiredError) Error() string {
if e.Reason != "" {
return fmt.Sprintf("required variable %s is missing a value: %s", e.Variable, e.Reason)
}
return fmt.Sprintf("required variable %s is missing a value", e.Variable)
}
// Mapping is a user-supplied function which maps from variable names to values.
// Returns the value as a string and a bool indicating whether
// the value is present, to distinguish between an empty string
@ -351,8 +364,9 @@ func withRequired(substitution string, mapping Mapping, sep string, valid func(s
}
value, ok := mapping(name)
if !ok || !valid(value) {
return "", true, &InvalidTemplateError{
Template: fmt.Sprintf("required variable %s is missing a value: %s", name, errorMessage),
return "", true, &MissingRequiredError{
Reason: errorMessage,
Variable: name,
}
}
return value, true, nil