fix(compose): provide the project name for proper validation BE-11375 (#117)

release/2.24
andres-portainer 2 weeks ago committed by GitHub
parent 370d224d76
commit 5a451b2035

@ -11,7 +11,6 @@ import (
"github.com/portainer/portainer/pkg/libstack" "github.com/portainer/portainer/pkg/libstack"
"github.com/compose-spec/compose-go/v2/consts"
"github.com/compose-spec/compose-go/v2/dotenv" "github.com/compose-spec/compose-go/v2/dotenv"
"github.com/compose-spec/compose-go/v2/loader" "github.com/compose-spec/compose-go/v2/loader"
"github.com/compose-spec/compose-go/v2/types" "github.com/compose-spec/compose-go/v2/types"
@ -106,13 +105,6 @@ func withComposeService(
if options.ProjectName != "" { if options.ProjectName != "" {
o.SetProjectName(options.ProjectName, true) o.SetProjectName(options.ProjectName, true)
} else if nameFromEnv, ok := configDetails.Environment[consts.ComposeProjectName]; ok && nameFromEnv != "" {
o.SetProjectName(nameFromEnv, true)
} else {
o.SetProjectName(
loader.NormalizeProjectName(filepath.Base(configDetails.WorkingDir)),
false,
)
} }
}, },
) )

Loading…
Cancel
Save