Skip to content

Commit 93128e8

Browse files
fix: progress bar image name flashes on push (#2965)
Signed-off-by: Austin Abro <[email protected]>
1 parent 86c7e21 commit 93128e8

File tree

1 file changed

+3
-6
lines changed
  • src/internal/packager/images

1 file changed

+3
-6
lines changed

src/internal/packager/images/push.go

+3-6
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ func Push(ctx context.Context, cfg PushConfig) error {
5353
registryURL = cfg.RegInfo.Address
5454
)
5555

56-
progress := message.NewProgressBar(totalSize, fmt.Sprintf("Pushing %d images", len(toPush)))
57-
defer progress.Close()
58-
5956
err = retry.Do(func() error {
6057
c, _ := cluster.NewCluster()
6158
if c != nil {
@@ -68,7 +65,8 @@ func Push(ctx context.Context, cfg PushConfig) error {
6865
}
6966
}
7067

71-
progress = message.NewProgressBar(totalSize, fmt.Sprintf("Pushing %d images", len(toPush)))
68+
progress := message.NewProgressBar(totalSize, fmt.Sprintf("Pushing %d images", len(toPush)))
69+
defer progress.Close()
7270
pushOptions := createPushOpts(cfg, progress)
7371

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

133-
progress.Successf("Pushed %d images", len(cfg.ImageList))
134-
135132
return nil
136133
}
137134

0 commit comments

Comments
 (0)