Ensure extensions map is not nil (should be set by compose-go)

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-11-19 10:28:57 +01:00
parent 251c52664a
commit 7c7e75ca00
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
2 changed files with 4 additions and 1 deletions

View File

@ -223,6 +223,9 @@ func (s *local) recreateContainer(ctx context.Context, project *types.Project, s
func setDependentLifecycle(project *types.Project, service string, strategy string) {
for i, s := range project.Services {
if contains(s.GetDependencies(), service) {
if s.Extensions == nil {
s.Extensions = map[string]interface{}{}
}
s.Extensions[extLifecycle] = strategy
project.Services[i] = s
}

View File

@ -101,7 +101,7 @@ func toMobyEnv(environment compose.MappingWithEquals) []string {
if v == nil {
env = append(env, k)
} else {
env = append(env, fmt.Sprintf("%s=%s", k, v))
env = append(env, fmt.Sprintf("%s=%s", k, *v))
}
}
return env