From 7c7e75ca0019d656aee583722c9751d0150f5393 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 19 Nov 2020 10:28:57 +0100 Subject: [PATCH] Ensure extensions map is not nil (should be set by compose-go) Signed-off-by: Nicolas De Loof --- local/convergence.go | 3 +++ local/convert.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/local/convergence.go b/local/convergence.go index bc5b89fc..b47899dd 100644 --- a/local/convergence.go +++ b/local/convergence.go @@ -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 } diff --git a/local/convert.go b/local/convert.go index 941ec95d..f0b834a7 100644 --- a/local/convert.go +++ b/local/convert.go @@ -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