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:
Nicolas De Loof 2020-08-13 10:27:01 +02:00
parent de99add26b
commit 8182c98abf
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
1 changed files with 0 additions and 31 deletions

View File

@ -5,13 +5,11 @@ import (
"fmt"
"os"
"os/signal"
"strings"
"syscall"
"github.com/compose-spec/compose-go/cli"
"github.com/compose-spec/compose-go/types"
"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 {
@ -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)
signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)
go func() {
@ -100,27 +90,6 @@ func (b *Backend) Up(ctx context.Context, options *cli.ProjectOptions) error {
}()
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
}