From 5a451b2035f6d8dfc23b1854f37ee22981d9c429 Mon Sep 17 00:00:00 2001 From: andres-portainer <91705312+andres-portainer@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:18:36 -0300 Subject: [PATCH] fix(compose): provide the project name for proper validation BE-11375 (#117) --- pkg/libstack/compose/composeplugin.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pkg/libstack/compose/composeplugin.go b/pkg/libstack/compose/composeplugin.go index 3c82ef379..acee07a90 100644 --- a/pkg/libstack/compose/composeplugin.go +++ b/pkg/libstack/compose/composeplugin.go @@ -11,7 +11,6 @@ import ( "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/loader" "github.com/compose-spec/compose-go/v2/types" @@ -106,13 +105,6 @@ func withComposeService( if options.ProjectName != "" { 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, - ) } }, )