Merge pull request #32333 from dnephin/fix-endpoint-mode
Fix endpoint mode loading from Compose file in stack deploy
This commit is contained in:
commit
93ffbb76c3
4 changed files with 5 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
version: "3"
|
version: "3.2"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
foo:
|
foo:
|
||||||
|
@ -45,6 +45,7 @@ services:
|
||||||
window: 120s
|
window: 120s
|
||||||
placement:
|
placement:
|
||||||
constraints: [node=foo]
|
constraints: [node=foo]
|
||||||
|
endpoint_mode: dnsrr
|
||||||
|
|
||||||
devices:
|
devices:
|
||||||
- "/dev/ttyUSB0:/dev/ttyUSB0"
|
- "/dev/ttyUSB0:/dev/ttyUSB0"
|
||||||
|
|
|
@ -220,9 +220,7 @@ func transform(source map[string]interface{}, target interface{}) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = decoder.Decode(source)
|
return decoder.Decode(source)
|
||||||
// TODO: log unused keys
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func transformHook(
|
func transformHook(
|
||||||
|
|
|
@ -674,6 +674,7 @@ func TestFullExample(t *testing.T) {
|
||||||
Placement: types.Placement{
|
Placement: types.Placement{
|
||||||
Constraints: []string{"node=foo"},
|
Constraints: []string{"node=foo"},
|
||||||
},
|
},
|
||||||
|
EndpointMode: "dnsrr",
|
||||||
},
|
},
|
||||||
Devices: []string{"/dev/ttyUSB0:/dev/ttyUSB0"},
|
Devices: []string{"/dev/ttyUSB0:/dev/ttyUSB0"},
|
||||||
DNS: []string{"8.8.8.8", "9.9.9.9"},
|
DNS: []string{"8.8.8.8", "9.9.9.9"},
|
||||||
|
|
|
@ -158,7 +158,7 @@ type DeployConfig struct {
|
||||||
Resources Resources
|
Resources Resources
|
||||||
RestartPolicy *RestartPolicy `mapstructure:"restart_policy"`
|
RestartPolicy *RestartPolicy `mapstructure:"restart_policy"`
|
||||||
Placement Placement
|
Placement Placement
|
||||||
EndpointMode string
|
EndpointMode string `mapstructure:"endpoint_mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// HealthCheckConfig the healthcheck configuration for a service
|
// HealthCheckConfig the healthcheck configuration for a service
|
||||||
|
|
Loading…
Reference in a new issue