Merge pull request #1170 from vdemeester/omit-silvin

Add omitempty on compose config top-level types
This commit is contained in:
Silvin 2018-07-02 14:16:53 +02:00 committed by GitHub
commit 18091ea7e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View File

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

View File

@ -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