diff --git a/compose/loader/full-example.yml b/compose/loader/full-example.yml index e8f3716013..3ffbcc3ea1 100644 --- a/compose/loader/full-example.yml +++ b/compose/loader/full-example.yml @@ -1,4 +1,4 @@ -version: "3" +version: "3.2" services: foo: @@ -45,6 +45,7 @@ services: window: 120s placement: constraints: [node=foo] + endpoint_mode: dnsrr devices: - "/dev/ttyUSB0:/dev/ttyUSB0" diff --git a/compose/loader/loader.go b/compose/loader/loader.go index d69b530e6c..2394ff8e2f 100644 --- a/compose/loader/loader.go +++ b/compose/loader/loader.go @@ -220,9 +220,7 @@ func transform(source map[string]interface{}, target interface{}) error { if err != nil { return err } - err = decoder.Decode(source) - // TODO: log unused keys - return err + return decoder.Decode(source) } func transformHook( diff --git a/compose/loader/loader_test.go b/compose/loader/loader_test.go index e7e2992ada..9e042d0a12 100644 --- a/compose/loader/loader_test.go +++ b/compose/loader/loader_test.go @@ -674,6 +674,7 @@ func TestFullExample(t *testing.T) { Placement: types.Placement{ Constraints: []string{"node=foo"}, }, + EndpointMode: "dnsrr", }, Devices: []string{"/dev/ttyUSB0:/dev/ttyUSB0"}, DNS: []string{"8.8.8.8", "9.9.9.9"}, diff --git a/compose/types/types.go b/compose/types/types.go index 19500e195d..1b4c4015ec 100644 --- a/compose/types/types.go +++ b/compose/types/types.go @@ -158,7 +158,7 @@ type DeployConfig struct { Resources Resources RestartPolicy *RestartPolicy `mapstructure:"restart_policy"` Placement Placement - EndpointMode string + EndpointMode string `mapstructure:"endpoint_mode"` } // HealthCheckConfig the healthcheck configuration for a service