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

Commit

Permalink
Don't pretend we know resources to be created
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ndeloof committed Aug 13, 2020
1 parent 32f671b commit 5277509
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions pkg/amazon/backend/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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() {
Expand All @@ -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
}

Expand Down

0 comments on commit 5277509

Please sign in to comment.