From 3fa7d23e1faec07644b31a7a017210548cf3ec82 Mon Sep 17 00:00:00 2001 From: "Daniel A.C. Martin" Date: Tue, 12 Jun 2018 15:23:51 +0100 Subject: [PATCH] Don't block waiting for individual deployments Waits until all resources have been created / updated before checking the roll-out of a deployment. This way it is possible to deploy quicker as deployments can roll-out parallel to one another. --- main.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index bbca4eb..4561c4d 100644 --- a/main.go +++ b/main.go @@ -189,6 +189,7 @@ func run(c *cli.Context) error { } } + watch := []*ObjectResource{} for _, r := range resources { if c.Bool("debug-templates") { logInfo.Printf("Template:\n" + string(r.Template[:])) @@ -199,7 +200,17 @@ func run(c *cli.Context) error { if err := deploy(c, r); err != nil { return err } + if isWatchableResouce(r) { + watch = append(watch, r) + } } + + for _, r := range watch { + if err := watchResource(c, r); err != nil { + return err + } + } + return nil } @@ -259,9 +270,6 @@ func deploy(c *cli.Context, r *ObjectResource) error { return err } logInfo.Print(outbuf.String()) - if isWatchableResouce(r) { - return watchResource(c, r) - } return nil }