diff --git a/compose.go b/compose.go index 6afb4e1..9272084 100644 --- a/compose.go +++ b/compose.go @@ -13,16 +13,17 @@ type DockerCompose struct { // Service a service declared in a Docker Compose file. type Service struct { - Image string `yaml:"image"` - Build string `yaml:"build"` - Volumes []string `yaml:"volumes"` - Entrypoint []string `yaml:"entrypoint"` - Ports []string `yaml:"ports"` - Environment []string `yaml:"environment"` - CapAdd []string `yaml:"cap_add"` - Tmpfs []string `yaml:"tmpfs"` - Deploy ServiceDeploy `yaml:"deploy"` - ExtraHosts []string `yaml:"extra_hosts"` + Image string `yaml:"image"` + Build string `yaml:"build"` + Volumes []string `yaml:"volumes"` + Entrypoint []string `yaml:"entrypoint"` + Ports []string `yaml:"ports"` + Environment []string `yaml:"environment"` + CapAdd []string `yaml:"cap_add"` + Tmpfs []string `yaml:"tmpfs"` + Deploy ServiceDeploy `yaml:"deploy"` + ExtraHosts []string `yaml:"extra_hosts"` + Labels map[string]string `yaml:"labels"` } // ServiceDeploy provides deployment information for a service. diff --git a/compose_test.go b/compose_test.go index dca0480..b8a1bd7 100644 --- a/compose_test.go +++ b/compose_test.go @@ -23,4 +23,5 @@ func TestLoad(t *testing.T) { assert.Equal(t, compose.Services["a"].Deploy.Resources.Limits.CPUs, "500m") assert.Equal(t, compose.Services["a"].Deploy.Resources.Limits.Memory, "2048Mi") assert.Equal(t, compose.Services["a"].ExtraHosts, []string{"some.hostname:1.2.3.4"}) + assert.Equal(t, compose.Services["a"].Labels, map[string]string{ "m8s.io/skip": "true"}) } diff --git a/test-data/test.yaml b/test-data/test.yaml index 68ed803..e8d7315 100644 --- a/test-data/test.yaml +++ b/test-data/test.yaml @@ -24,4 +24,6 @@ services: cpus: '500m' memory: '2048Mi' extra_hosts: - - "some.hostname:1.2.3.4" \ No newline at end of file + - "some.hostname:1.2.3.4" + labels: + "m8s.io/skip": "true"