summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Vieux <vieux@docker.com>2016-06-12 00:46:17 -0700
committerTonis Tiigi <tonistiigi@gmail.com>2016-06-13 18:22:35 -0700
commitdbc78aa2f092a0baa4036cb544b9a0fd209b5fb0 (patch)
treef9a4679a8507ea574e2f51bc2e00ecb13c2a6a1c
parent32a4a573b22b0d084ea41f66b5347429a223ec70 (diff)
downloaddocker-dbc78aa2f092a0baa4036cb544b9a0fd209b5fb0.tar.gz
fix case
Signed-off-by: Victor Vieux <vieux@docker.com>
-rw-r--r--daemon/cluster/convert/container.go5
-rw-r--r--daemon/cluster/convert/service.go6
2 files changed, 6 insertions, 5 deletions
diff --git a/daemon/cluster/convert/container.go b/daemon/cluster/convert/container.go
index 4b519f6d26..48744dec57 100644
--- a/daemon/cluster/convert/container.go
+++ b/daemon/cluster/convert/container.go
@@ -2,6 +2,7 @@ package convert
import (
"fmt"
+ "strings"
types "github.com/docker/engine-api/types/swarm"
swarmapi "github.com/docker/swarmkit/api"
@@ -73,13 +74,13 @@ func containerToGRPC(c types.ContainerSpec) (*swarmapi.ContainerSpec, error) {
Writable: m.Writable,
}
- if mountType, ok := swarmapi.Mount_MountType_value[string(m.Type)]; ok {
+ if mountType, ok := swarmapi.Mount_MountType_value[strings.ToUpper(string(m.Type))]; ok {
mount.Type = swarmapi.Mount_MountType(mountType)
} else if string(m.Type) != "" {
return nil, fmt.Errorf("invalid MountType: %q", m.Type)
}
- if mountPropagation, ok := swarmapi.Mount_MountPropagation_value[string(m.Propagation)]; ok {
+ if mountPropagation, ok := swarmapi.Mount_MountPropagation_value[strings.ToUpper(string(m.Propagation))]; ok {
mount.Propagation = swarmapi.Mount_MountPropagation(mountPropagation)
} else if string(m.Propagation) != "" {
return nil, fmt.Errorf("invalid MountPropagation: %q", m.Propagation)
diff --git a/daemon/cluster/convert/service.go b/daemon/cluster/convert/service.go
index 095347a005..b8fe005331 100644
--- a/daemon/cluster/convert/service.go
+++ b/daemon/cluster/convert/service.go
@@ -137,8 +137,8 @@ func ServiceSpecToGRPC(s types.ServiceSpec) (swarmapi.ServiceSpec, error) {
spec.Endpoint = &swarmapi.EndpointSpec{}
- spec.Endpoint.Mode = swarmapi.EndpointSpec_ResolutionMode(swarmapi.EndpointSpec_ResolutionMode_value[string(s.EndpointSpec.Mode)])
- spec.Endpoint.Ingress = swarmapi.EndpointSpec_IngressRouting(swarmapi.EndpointSpec_IngressRouting_value[string(s.EndpointSpec.Ingress)])
+ spec.Endpoint.Mode = swarmapi.EndpointSpec_ResolutionMode(swarmapi.EndpointSpec_ResolutionMode_value[strings.ToUpper(string(s.EndpointSpec.Mode))])
+ spec.Endpoint.Ingress = swarmapi.EndpointSpec_IngressRouting(swarmapi.EndpointSpec_IngressRouting_value[strings.ToUpper(string(s.EndpointSpec.Ingress))])
for _, portConfig := range s.EndpointSpec.ExposedPorts {
spec.Endpoint.ExposedPorts = append(spec.Endpoint.ExposedPorts, &swarmapi.PortConfig{
@@ -233,7 +233,7 @@ func restartPolicyToGRPC(p *types.RestartPolicy) (*swarmapi.RestartPolicy, error
var rp *swarmapi.RestartPolicy
if p != nil {
rp = &swarmapi.RestartPolicy{}
- if condition, ok := swarmapi.RestartPolicy_RestartCondition_value[string(p.Condition)]; ok {
+ if condition, ok := swarmapi.RestartPolicy_RestartCondition_value[strings.ToUpper(string(p.Condition))]; ok {
rp.Condition = swarmapi.RestartPolicy_RestartCondition(condition)
} else if string(p.Condition) == "" {
rp.Condition = swarmapi.RestartOnAny