refactor!: do not set default timeout
Some checks failed
continuous-integration/drone/push Build is failing

See #596

Quite some `i18n.G` additions along the way!
This commit is contained in:
2025-08-25 11:38:07 +02:00
parent 44a7d288af
commit 6a52575ae0
10 changed files with 99 additions and 79 deletions

View File

@ -7,10 +7,12 @@ import (
"sort"
"strings"
"coopcloud.tech/abra/pkg/i18n"
"coopcloud.tech/abra/pkg/log"
"github.com/docker/cli/cli/compose/loader"
"github.com/docker/cli/cli/compose/schema"
composetypes "github.com/docker/cli/cli/compose/types"
"github.com/pkg/errors"
)
// DontSkipValidation ensures validation is done for compose file loading
@ -38,8 +40,7 @@ func LoadComposefile(opts Deploy, appEnv map[string]string, options ...func(*loa
config, err := loader.Load(configDetails, options...)
if err != nil {
if fpe, ok := err.(*loader.ForbiddenPropertiesError); ok {
return nil, fmt.Errorf("compose file contains unsupported options: %s",
propertyWarnings(fpe.Properties))
return nil, errors.New(i18n.G("compose file contains unsupported options: %s", propertyWarnings(fpe.Properties)))
}
return nil, err
}
@ -51,14 +52,12 @@ func LoadComposefile(opts Deploy, appEnv map[string]string, options ...func(*loa
unsupportedProperties := loader.GetUnsupportedProperties(dicts...)
if len(unsupportedProperties) > 0 {
log.Warnf("%s: ignoring unsupported options: %s",
recipeName, strings.Join(unsupportedProperties, ", "))
log.Warn(i18n.G("%s: ignoring unsupported options: %s", recipeName, strings.Join(unsupportedProperties, ", ")))
}
deprecatedProperties := loader.GetDeprecatedProperties(dicts...)
if len(deprecatedProperties) > 0 {
log.Warnf("%s: ignoring deprecated options: %s",
recipeName, propertyWarnings(deprecatedProperties))
log.Warn(i18n.G("%s: ignoring deprecated options: %s", recipeName, propertyWarnings(deprecatedProperties)))
}
return config, nil
}
@ -106,7 +105,7 @@ func buildEnvironment(env []string) (map[string]string, error) {
for _, s := range env {
// if value is empty, s is like "K=", not "K".
if !strings.Contains(s, "=") {
return result, fmt.Errorf("unexpected environment %q", s)
return result, errors.New(i18n.G("unexpected environment %q", s))
}
kv := strings.SplitN(s, "=", 2)
result[kv[0]] = kv[1]