From 33bfb1e5e5c5f492c1ec5677def64a4b052b6222 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 13 Mar 2017 14:53:13 -0400 Subject: [PATCH] Move endpoint_mode under deploy and add it to the schema. Signed-off-by: Daniel Nephin --- compose/convert/service.go | 2 +- compose/schema/data/config_schema_v3.1.json | 1 + compose/types/types.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compose/convert/service.go b/compose/convert/service.go index 55368e2410..ece6d5c0f6 100644 --- a/compose/convert/service.go +++ b/compose/convert/service.go @@ -55,7 +55,7 @@ func convertService( ) (swarm.ServiceSpec, error) { name := namespace.Scope(service.Name) - endpoint, err := convertEndpointSpec(service.EndpointMode, service.Ports) + endpoint, err := convertEndpointSpec(service.Deploy.EndpointMode, service.Ports) if err != nil { return swarm.ServiceSpec{}, err } diff --git a/compose/schema/data/config_schema_v3.1.json b/compose/schema/data/config_schema_v3.1.json index c5e48968e3..72e1d61bb6 100644 --- a/compose/schema/data/config_schema_v3.1.json +++ b/compose/schema/data/config_schema_v3.1.json @@ -293,6 +293,7 @@ "type": ["object", "null"], "properties": { "mode": {"type": "string"}, + "endpoint_mode": {"type": "string"}, "replicas": {"type": "integer"}, "labels": {"$ref": "#/definitions/list_or_dict"}, "update_config": { diff --git a/compose/types/types.go b/compose/types/types.go index d1d762900d..e91b5a7ac8 100644 --- a/compose/types/types.go +++ b/compose/types/types.go @@ -89,7 +89,6 @@ type ServiceConfig struct { DNS StringList DNSSearch StringList `mapstructure:"dns_search"` DomainName string `mapstructure:"domainname"` - EndpointMode string Entrypoint ShellCommand Environment MappingWithEquals EnvFile StringList `mapstructure:"env_file"` @@ -157,6 +156,7 @@ type DeployConfig struct { Resources Resources RestartPolicy *RestartPolicy `mapstructure:"restart_policy"` Placement Placement + EndpointMode string } // HealthCheckConfig the healthcheck configuration for a service