Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix endpoint mode loading from Compose file in stack deploy #32333

Merged
merged 1 commit into from
Apr 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cli/compose/loader/full-example.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3"
version: "3.2"

services:
foo:
Expand Down Expand Up @@ -45,6 +45,7 @@ services:
window: 120s
placement:
constraints: [node=foo]
endpoint_mode: dnsrr

devices:
- "/dev/ttyUSB0:/dev/ttyUSB0"
Expand Down
4 changes: 1 addition & 3 deletions cli/compose/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions cli/compose/loader/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
2 changes: 1 addition & 1 deletion cli/compose/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down