|
@@ -31,57 +31,11 @@ const (
|
|
|
ParameterLoadBalancerARN = "ParameterLoadBalancerARN"
|
|
ParameterLoadBalancerARN = "ParameterLoadBalancerARN"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
-type FargateCompatibilityChecker struct {
|
|
|
|
|
- compatibility.AllowList
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-func (c *FargateCompatibilityChecker) CheckPortsPublished(p *types.ServicePortConfig) {
|
|
|
|
|
- if p.Published == 0 {
|
|
|
|
|
- p.Published = p.Target
|
|
|
|
|
- }
|
|
|
|
|
- if p.Published != p.Target {
|
|
|
|
|
- c.Incompatible("published port can't be set to a distinct value than container port")
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-func (c *FargateCompatibilityChecker) CheckCapAdd(service *types.ServiceConfig) {
|
|
|
|
|
- add := []string{}
|
|
|
|
|
- for _, cap := range service.CapAdd {
|
|
|
|
|
- switch cap {
|
|
|
|
|
- case "SYS_PTRACE":
|
|
|
|
|
- add = append(add, cap)
|
|
|
|
|
- default:
|
|
|
|
|
- c.Incompatible("ECS doesn't allow to add capability %s", cap)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- service.CapAdd = add
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// Convert a compose project into a CloudFormation template
|
|
// Convert a compose project into a CloudFormation template
|
|
|
func (b Backend) Convert(project *types.Project) (*cloudformation.Template, error) {
|
|
func (b Backend) Convert(project *types.Project) (*cloudformation.Template, error) {
|
|
|
var checker compatibility.Checker = &FargateCompatibilityChecker{
|
|
var checker compatibility.Checker = &FargateCompatibilityChecker{
|
|
|
compatibility.AllowList{
|
|
compatibility.AllowList{
|
|
|
- Supported: []string{
|
|
|
|
|
- "services.command",
|
|
|
|
|
- "services.container_name",
|
|
|
|
|
- "services.cap_drop",
|
|
|
|
|
- "services.depends_on",
|
|
|
|
|
- "services.entrypoint",
|
|
|
|
|
- "services.environment",
|
|
|
|
|
- "services.init",
|
|
|
|
|
- "services.healthcheck",
|
|
|
|
|
- "services.healthcheck.interval",
|
|
|
|
|
- "services.healthcheck.start_period",
|
|
|
|
|
- "services.healthcheck.test",
|
|
|
|
|
- "services.healthcheck.timeout",
|
|
|
|
|
- "services.networks",
|
|
|
|
|
- "services.ports",
|
|
|
|
|
- "services.ports.mode",
|
|
|
|
|
- "services.ports.target",
|
|
|
|
|
- "services.ports.protocol",
|
|
|
|
|
- "services.user",
|
|
|
|
|
- "services.working_dir",
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ Supported: compatibleComposeAttributes,
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
compatibility.Check(project, checker)
|
|
compatibility.Check(project, checker)
|