vendor: github.com/compose-spec/compose-go/v2 v2.1.2

Replaces uses of the github.com/mitchellh/mapstructure module, which
was deprecated by the owner and moved to new maintainership at
github.com/go-viper/mapstructure.

The old module is still referenced as indirect dependency (through
docker/cli and theupdateframework/notary), but not used in code, and
should eventually go away.

full diff: https://github.com/compose-spec/compose-go/compare/v2.1.1...v2.1.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-06-06 12:44:51 +02:00
parent 747b75a217
commit 9e5ba66553
27 changed files with 1519 additions and 488 deletions

View File

@ -215,14 +215,16 @@ func WithLoadOptions(loadOptions ...func(*loader.Options)) ProjectOptionsFn {
// WithDefaultProfiles uses the provided profiles (if any), and falls back to
// profiles specified via the COMPOSE_PROFILES environment variable otherwise.
func WithDefaultProfiles(profile ...string) ProjectOptionsFn {
if len(profile) == 0 {
for _, s := range strings.Split(os.Getenv(consts.ComposeProfiles), ",") {
profile = append(profile, strings.TrimSpace(s))
func WithDefaultProfiles(profiles ...string) ProjectOptionsFn {
return func(o *ProjectOptions) error {
if len(profiles) == 0 {
for _, s := range strings.Split(o.Environment[consts.ComposeProfiles], ",") {
profiles = append(profiles, strings.TrimSpace(s))
}
}
o.loadOptions = append(o.loadOptions, loader.WithProfiles(profiles))
return nil
}
return WithProfiles(profile)
}
// WithProfiles sets profiles to be activated

View File

@ -39,7 +39,7 @@ import (
"github.com/compose-spec/compose-go/v2/tree"
"github.com/compose-spec/compose-go/v2/types"
"github.com/compose-spec/compose-go/v2/validation"
"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
"github.com/sirupsen/logrus"
"golang.org/x/exp/slices"
"gopkg.in/yaml.v3"

View File

@ -206,7 +206,7 @@ func envFileIndexer(y any, p tree.Path) (string, error) {
if pathValue, ok := value["path"]; ok {
return pathValue.(string), nil
}
return "", fmt.Errorf("environment path attribut %s is missing", p)
return "", fmt.Errorf("environment path attribute %s is missing", p)
}
return "", nil
}

View File

@ -21,7 +21,7 @@ import (
"github.com/compose-spec/compose-go/v2/tree"
"github.com/compose-spec/compose-go/v2/types"
"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
)
func transformPorts(data any, p tree.Path, ignoreParseError bool) (any, error) {

View File

@ -21,7 +21,7 @@ import (
"runtime"
"strings"
"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
)
var (