mirror of https://github.com/docker/compose.git
fix custom vpc setup
Signed-off-by: aiordache <anca.iordache@docker.com> Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
716fd13690
commit
1cde947297
|
@ -1,6 +1,6 @@
|
|||
# syntax = docker/dockerfile:experimental
|
||||
ARG GO_VERSION=1.14.4-alpine
|
||||
ARG ALPINE_PKG_DOCKER_VERSION=19.03.11-r0
|
||||
ARG ALPINE_PKG_DOCKER_VERSION=19.03.12-r0
|
||||
ARG GOLANGCI_LINT_VERSION=v1.27.0-alpine
|
||||
|
||||
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS base
|
||||
|
|
|
@ -40,6 +40,9 @@ func (b *Backend) Up(ctx context.Context, options cli.ProjectOptions) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(subNets) < 2 {
|
||||
return fmt.Errorf("VPC %s should have at least 2 associated subnets in different availability zones", vpc)
|
||||
}
|
||||
|
||||
lb, err := b.GetLoadBalancer(ctx, project)
|
||||
if err != nil {
|
||||
|
@ -95,6 +98,7 @@ func (b Backend) GetVPC(ctx context.Context, project *types.Project) (string, er
|
|||
if !ok {
|
||||
return "", fmt.Errorf("VPC does not exist: %s", vpc)
|
||||
}
|
||||
return vpcID, nil
|
||||
}
|
||||
defaultVPC, err := b.api.GetDefaultVPC(ctx)
|
||||
if err != nil {
|
||||
|
|
|
@ -125,10 +125,6 @@ func (s sdk) GetSubNets(ctx context.Context, vpcID string) ([]string, error) {
|
|||
Name: aws.String("vpc-id"),
|
||||
Values: []*string{aws.String(vpcID)},
|
||||
},
|
||||
{
|
||||
Name: aws.String("default-for-az"),
|
||||
Values: []*string{aws.String("true")},
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue