mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-12 14:37:08 +08:00
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:
14
vendor/github.com/compose-spec/compose-go/v2/cli/options.go
generated
vendored
14
vendor/github.com/compose-spec/compose-go/v2/cli/options.go
generated
vendored
@ -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
|
||||
|
Reference in New Issue
Block a user