Move endpoint_mode under deploy and add it to the schema.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2017-03-13 14:53:13 -04:00
parent cd1cde6e77
commit 33bfb1e5e5
3 changed files with 3 additions and 2 deletions

View File

@ -55,7 +55,7 @@ func convertService(
) (swarm.ServiceSpec, error) { ) (swarm.ServiceSpec, error) {
name := namespace.Scope(service.Name) name := namespace.Scope(service.Name)
endpoint, err := convertEndpointSpec(service.EndpointMode, service.Ports) endpoint, err := convertEndpointSpec(service.Deploy.EndpointMode, service.Ports)
if err != nil { if err != nil {
return swarm.ServiceSpec{}, err return swarm.ServiceSpec{}, err
} }

View File

@ -293,6 +293,7 @@
"type": ["object", "null"], "type": ["object", "null"],
"properties": { "properties": {
"mode": {"type": "string"}, "mode": {"type": "string"},
"endpoint_mode": {"type": "string"},
"replicas": {"type": "integer"}, "replicas": {"type": "integer"},
"labels": {"$ref": "#/definitions/list_or_dict"}, "labels": {"$ref": "#/definitions/list_or_dict"},
"update_config": { "update_config": {

View File

@ -89,7 +89,6 @@ type ServiceConfig struct {
DNS StringList DNS StringList
DNSSearch StringList `mapstructure:"dns_search"` DNSSearch StringList `mapstructure:"dns_search"`
DomainName string `mapstructure:"domainname"` DomainName string `mapstructure:"domainname"`
EndpointMode string
Entrypoint ShellCommand Entrypoint ShellCommand
Environment MappingWithEquals Environment MappingWithEquals
EnvFile StringList `mapstructure:"env_file"` EnvFile StringList `mapstructure:"env_file"`
@ -157,6 +156,7 @@ type DeployConfig struct {
Resources Resources Resources Resources
RestartPolicy *RestartPolicy `mapstructure:"restart_policy"` RestartPolicy *RestartPolicy `mapstructure:"restart_policy"`
Placement Placement Placement Placement
EndpointMode string
} }
// HealthCheckConfig the healthcheck configuration for a service // HealthCheckConfig the healthcheck configuration for a service