Browse Source

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

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 5 năm trước cách đây
mục cha
commit
7c7e75ca00
2 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 3 0
      local/convergence.go
  2. 1 1
      local/convert.go

+ 3 - 0
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
 		}

+ 1 - 1
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