mirror of https://github.com/docker/compose.git
Don't pretend we know resources to be created
some resources are controlled by a CloudFormation Condition and as such won't be created. If we add them to the progresswriter, the latter will never receive status update. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
de99add26b
commit
8182c98abf
|
@ -5,13 +5,11 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"strings"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/compose-spec/compose-go/cli"
|
"github.com/compose-spec/compose-go/cli"
|
||||||
"github.com/compose-spec/compose-go/types"
|
"github.com/compose-spec/compose-go/types"
|
||||||
"github.com/docker/ecs-plugin/pkg/compose"
|
"github.com/docker/ecs-plugin/pkg/compose"
|
||||||
"github.com/docker/ecs-plugin/pkg/progress"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (b *Backend) Up(ctx context.Context, options *cli.ProjectOptions) error {
|
func (b *Backend) Up(ctx context.Context, options *cli.ProjectOptions) error {
|
||||||
|
@ -83,14 +81,6 @@ func (b *Backend) Up(ctx context.Context, options *cli.ProjectOptions) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for k := range template.Resources {
|
|
||||||
b.writer.Event(progress.Event{
|
|
||||||
ID: k,
|
|
||||||
Status: progress.Working,
|
|
||||||
StatusText: "Pending",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
signalChan := make(chan os.Signal, 1)
|
signalChan := make(chan os.Signal, 1)
|
||||||
signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)
|
signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -100,27 +90,6 @@ func (b *Backend) Up(ctx context.Context, options *cli.ProjectOptions) error {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
err = b.WaitStackCompletion(ctx, project.Name, operation)
|
err = b.WaitStackCompletion(ctx, project.Name, operation)
|
||||||
// update status for external resources (LB and cluster)
|
|
||||||
loadBalancerName := fmt.Sprintf("%.32s", fmt.Sprintf("%sLoadBalancer", strings.Title(project.Name)))
|
|
||||||
for k := range template.Resources {
|
|
||||||
switch k {
|
|
||||||
case "Cluster":
|
|
||||||
if cluster == "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
case loadBalancerName:
|
|
||||||
if lb == "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
b.writer.Event(progress.Event{
|
|
||||||
ID: k,
|
|
||||||
Status: progress.Done,
|
|
||||||
StatusText: "",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue