Skip to content

Commit

Permalink
fix: progress bar image name flashes on push (zarf-dev#2965)
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Rob Ferguson <rjferguson21@gmail.com>
  • Loading branch information
AustinAbro321 authored and rjferguson21 committed Sep 5, 2024
1 parent 36bfd2e commit f627d3e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/internal/packager/images/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ func Push(ctx context.Context, cfg PushConfig) error {
registryURL = cfg.RegInfo.Address
)

progress := message.NewProgressBar(totalSize, fmt.Sprintf("Pushing %d images", len(toPush)))
defer progress.Close()

err = retry.Do(func() error {
c, _ := cluster.NewCluster()
if c != nil {
Expand All @@ -68,7 +65,8 @@ func Push(ctx context.Context, cfg PushConfig) error {
}
}

progress = message.NewProgressBar(totalSize, fmt.Sprintf("Pushing %d images", len(toPush)))
progress := message.NewProgressBar(totalSize, fmt.Sprintf("Pushing %d images", len(toPush)))
defer progress.Close()
pushOptions := createPushOpts(cfg, progress)

pushImage := func(img v1.Image, name string) error {
Expand Down Expand Up @@ -124,14 +122,13 @@ func Push(ctx context.Context, cfg PushConfig) error {
pushed = append(pushed, refInfo)
totalSize -= size
}
progress.Successf("Pushed %d images", len(cfg.ImageList))
return nil
}, retry.Context(ctx), retry.Attempts(uint(cfg.Retries)), retry.Delay(500*time.Millisecond))
if err != nil {
return err
}

progress.Successf("Pushed %d images", len(cfg.ImageList))

return nil
}

Expand Down

0 comments on commit f627d3e

Please sign in to comment.