From 9386a64dd33f212d9cb4cfbcc4bc5ef2749ee6de Mon Sep 17 00:00:00 2001 From: Ian Edwards Date: Thu, 21 Sep 2023 10:01:44 -0400 Subject: [PATCH] include env groups defined in porter.yaml --- internal/porter_app/v2/yaml.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/porter_app/v2/yaml.go b/internal/porter_app/v2/yaml.go index 107288406c..d93bc65e2b 100644 --- a/internal/porter_app/v2/yaml.go +++ b/internal/porter_app/v2/yaml.go @@ -88,6 +88,16 @@ func AppProtoFromYaml(ctx context.Context, porterYamlBytes []byte, appName strin appProto.Predeploy = predeployProto } + envGroups := make([]*porterv1.EnvGroup, 0) + if porterYaml.EnvGroups != nil { + for _, envGroupName := range porterYaml.EnvGroups { + envGroups = append(envGroups, &porterv1.EnvGroup{ + Name: envGroupName, + }) + } + } + appProto.EnvGroups = envGroups + return appProto, porterYaml.Env, nil } @@ -100,7 +110,7 @@ type PorterYAML struct { Env map[string]string `yaml:"env"` Predeploy *Service `yaml:"predeploy"` - EnvGroups []string `yaml:"env_groups,omitempty"` + EnvGroups []string `yaml:"envGroups,omitempty"` } // Build represents the build settings for a Porter app