compose/ecs/pkg/amazon/validate.go
Nicolas De Loof 9a6fe86a86
Introduce "Validate" phase to check/make app ECS-compliant
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-17 21:25:45 +02:00

20 lines
612 B
Go

package amazon
import (
"github.com/compose-spec/compose-go/types"
"github.com/docker/ecs-plugin/pkg/compose"
)
// Validate check the compose model do not use unsupported features and inject sane defaults for ECS deployment
func (c *client) Validate(project *compose.Project) error {
if len(project.Networks) == 0 {
// Compose application model implies a default network if none is explicitly set.
// FIXME move this to compose-go
project.Networks["default"] = types.NetworkConfig{
Name: "default",
}
}
// Here we can check for incompatible attributes, inject sane defaults, etc
return nil
}