diff --git a/cli/command/stack/kubernetes/stackclient_test.go b/cli/command/stack/kubernetes/stackclient_test.go index da4a3426aa..507a589891 100644 --- a/cli/command/stack/kubernetes/stackclient_test.go +++ b/cli/command/stack/kubernetes/stackclient_test.go @@ -32,10 +32,6 @@ services: image: bar foo: image: foo -networks: {} -volumes: {} -secrets: {} -configs: {} `), s.ComposeFile) } diff --git a/cli/compose/types/types.go b/cli/compose/types/types.go index 6c1a0dd758..cad26d58b0 100644 --- a/cli/compose/types/types.go +++ b/cli/compose/types/types.go @@ -73,11 +73,11 @@ type Config struct { Filename string `yaml:"-"` Version string Services Services - Networks map[string]NetworkConfig - Volumes map[string]VolumeConfig - Secrets map[string]SecretConfig - Configs map[string]ConfigObjConfig - Extras map[string]interface{} `yaml:",inline"` + Networks map[string]NetworkConfig `yaml:",omitempty"` + Volumes map[string]VolumeConfig `yaml:",omitempty"` + Secrets map[string]SecretConfig `yaml:",omitempty"` + Configs map[string]ConfigObjConfig `yaml:",omitempty"` + Extras map[string]interface{} `yaml:",inline"` } // Services is a list of ServiceConfig