Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

Commit 11c2b7a

Browse files
committed
Reject compose file not setting service image
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
1 parent e05fc71 commit 11c2b7a

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

pkg/amazon/backend/cloudformation.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func (c *FargateCompatibilityChecker) CheckPortsPublished(p *types.ServicePortCo
4040
}
4141
if p.Published != p.Target {
4242
c.Error("published port can't be set to a distinct value than container port")
43+
p.Published = p.Target
4344
}
4445
}
4546

pkg/amazon/backend/convert.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ import (
1717
)
1818

1919
func Convert(project *types.Project, service types.ServiceConfig) (*ecs.TaskDefinition, error) {
20+
if service.Image == "" {
21+
return nil, fmt.Errorf("service %s doesn't define a Docker image to run", service.Name)
22+
}
23+
2024
cpu, mem, err := toLimits(service)
2125
if err != nil {
2226
return nil, err

0 commit comments

Comments
 (0)