bake: support null arg value

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2022-12-03 17:34:15 +01:00
parent e21f56e801
commit df4957307f
7 changed files with 264 additions and 132 deletions

View File

@ -193,16 +193,16 @@ func loadDotEnv(curenv map[string]string, workingDir string) (map[string]string,
return curenv, nil
}
func flatten(in compose.MappingWithEquals) compose.Mapping {
func flatten(in compose.MappingWithEquals) map[string]*string {
if len(in) == 0 {
return nil
}
out := compose.Mapping{}
out := map[string]*string{}
for k, v := range in {
if v == nil {
continue
}
out[k] = *v
out[k] = v
}
return out
}