Skip to content

Commit 60dafde

Browse files
committed
Log warning if deploy key is found in compose project
1 parent 460b911 commit 60dafde

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

ecs-cli/modules/cli/compose/project/project_parseV3.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package project
33
import (
44
"io/ioutil"
55
"path/filepath"
6+
"reflect"
67

78
"github.com/aws/amazon-ecs-cli/ecs-cli/modules/cli/compose/containerconfig"
89
"github.com/aws/amazon-ecs-cli/ecs-cli/modules/utils/compose"
@@ -168,7 +169,8 @@ func convertToContainerConfig(serviceConfig types.ServiceConfig) (*containerconf
168169
c.MountPoints = mountPoints
169170
}
170171

171-
// TODO: add Environtment, EnvFile to ContainerConfig
172+
logWarningForDeployFields(serviceConfig.Deploy, serviceConfig.Name)
173+
172174
// TODO: log out unsupported fields
173175
return c, nil
174176
}
@@ -192,3 +194,17 @@ func convertPortConfigToECSMapping(portConfig types.ServicePortConfig) *ecs.Port
192194
}
193195
return &ecsMapping
194196
}
197+
198+
func logWarningForDeployFields(d types.DeployConfig, serviceName string) {
199+
if d.Resources.Limits != nil || d.Resources.Reservations != nil {
200+
log.WithFields(log.Fields{
201+
"option name": "deploy",
202+
"service name": serviceName,
203+
}).Warn("Skipping unsupported YAML option for service... service-level resources should be configured in the ecs-param.yml file.")
204+
} else if !reflect.DeepEqual(d, types.DeployConfig{}) {
205+
log.WithFields(log.Fields{
206+
"option name": "deploy",
207+
"service name": serviceName,
208+
}).Warn("Skipping unsupported YAML option for service...")
209+
}
210+
}

0 commit comments

Comments
 (0)