From a0b4886eba755a5afdfc5a6e6bf94ab72212a5d6 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Tue, 12 Oct 2021 10:25:37 +0200 Subject: [PATCH] WIP: default to compose.yml instead of all of 'em --- pkg/config/app.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/config/app.go b/pkg/config/app.go index a9f22d758..9c07de0c6 100644 --- a/pkg/config/app.go +++ b/pkg/config/app.go @@ -334,17 +334,15 @@ func GetAppStatuses(appFiles AppFiles) (map[string]map[string]string, error) { // GetAppComposeFiles gets the list of compose files for an app which should be // merged into a composetypes.Config while respecting the COMPOSE_FILE env var. func GetAppComposeFiles(recipe string, appEnv AppEnv) ([]string, error) { + var composeFiles []string + if _, ok := appEnv["COMPOSE_FILE"]; !ok { - logrus.Debug("no COMPOSE_FILE detected, loading all compose files") - pattern := fmt.Sprintf("%s/%s/compose**yml", APPS_DIR, recipe) - composeFiles, err := filepath.Glob(pattern) - if err != nil { - return composeFiles, err - } + logrus.Debug("no COMPOSE_FILE detected, loading compose.yml") + path := fmt.Sprintf("%s/%s/compose.yml", APPS_DIR, recipe) + composeFiles = append (composeFiles, path) return composeFiles, nil } - var composeFiles []string composeFileEnvVar := appEnv["COMPOSE_FILE"] envVars := strings.Split(composeFileEnvVar, ":") logrus.Debugf("COMPOSE_FILE detected ('%s'), loading '%s'", composeFileEnvVar, strings.Join(envVars, ", "))