Browse Source

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 <[email protected]>
Nicolas De Loof 5 years ago
parent
commit
8182c98abf
1 changed files with 0 additions and 31 deletions
  1. 0 31
      ecs/pkg/amazon/backend/up.go

+ 0 - 31
ecs/pkg/amazon/backend/up.go

@@ -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
 }