Add omitempty on compose config top-level types

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2018-07-02 12:04:09 +02:00
parent 7c7c299eee
commit f05ab2b1fb
No known key found for this signature in database
GPG Key ID: 083CC6FD6EB699A3
2 changed files with 5 additions and 9 deletions

View File

@ -32,10 +32,6 @@ services:
image: bar image: bar
foo: foo:
image: foo image: foo
networks: {}
volumes: {}
secrets: {}
configs: {}
`), s.ComposeFile) `), s.ComposeFile)
} }

View File

@ -73,10 +73,10 @@ type Config struct {
Filename string `yaml:"-"` Filename string `yaml:"-"`
Version string Version string
Services Services Services Services
Networks map[string]NetworkConfig Networks map[string]NetworkConfig `yaml:",omitempty"`
Volumes map[string]VolumeConfig Volumes map[string]VolumeConfig `yaml:",omitempty"`
Secrets map[string]SecretConfig Secrets map[string]SecretConfig `yaml:",omitempty"`
Configs map[string]ConfigObjConfig Configs map[string]ConfigObjConfig `yaml:",omitempty"`
Extras map[string]interface{} `yaml:",inline"` Extras map[string]interface{} `yaml:",inline"`
} }