Browse code

Move endpoint_mode under deploy and add it to the schema.

Signed-off-by: Daniel Nephin <dnephin@docker.com>

Daniel Nephin authored on 2017/03/14 03:53:13
Showing 3 changed files
... ...
@@ -55,7 +55,7 @@ func convertService(
55 55
 ) (swarm.ServiceSpec, error) {
56 56
 	name := namespace.Scope(service.Name)
57 57
 
58
-	endpoint, err := convertEndpointSpec(service.EndpointMode, service.Ports)
58
+	endpoint, err := convertEndpointSpec(service.Deploy.EndpointMode, service.Ports)
59 59
 	if err != nil {
60 60
 		return swarm.ServiceSpec{}, err
61 61
 	}
... ...
@@ -293,6 +293,7 @@
293 293
       "type": ["object", "null"],
294 294
       "properties": {
295 295
         "mode": {"type": "string"},
296
+        "endpoint_mode": {"type": "string"},
296 297
         "replicas": {"type": "integer"},
297 298
         "labels": {"$ref": "#/definitions/list_or_dict"},
298 299
         "update_config": {
... ...
@@ -89,7 +89,6 @@ type ServiceConfig struct {
89 89
 	DNS             StringList
90 90
 	DNSSearch       StringList `mapstructure:"dns_search"`
91 91
 	DomainName      string     `mapstructure:"domainname"`
92
-	EndpointMode    string
93 92
 	Entrypoint      ShellCommand
94 93
 	Environment     MappingWithEquals
95 94
 	EnvFile         StringList `mapstructure:"env_file"`
... ...
@@ -157,6 +156,7 @@ type DeployConfig struct {
157 157
 	Resources     Resources
158 158
 	RestartPolicy *RestartPolicy `mapstructure:"restart_policy"`
159 159
 	Placement     Placement
160
+	EndpointMode  string
160 161
 }
161 162
 
162 163
 // HealthCheckConfig the healthcheck configuration for a service