@@ -53,9 +53,6 @@ func Push(ctx context.Context, cfg PushConfig) error {
53
53
registryURL = cfg .RegInfo .Address
54
54
)
55
55
56
- progress := message .NewProgressBar (totalSize , fmt .Sprintf ("Pushing %d images" , len (toPush )))
57
- defer progress .Close ()
58
-
59
56
err = retry .Do (func () error {
60
57
c , _ := cluster .NewCluster ()
61
58
if c != nil {
@@ -68,7 +65,8 @@ func Push(ctx context.Context, cfg PushConfig) error {
68
65
}
69
66
}
70
67
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 ()
72
70
pushOptions := createPushOpts (cfg , progress )
73
71
74
72
pushImage := func (img v1.Image , name string ) error {
@@ -124,14 +122,13 @@ func Push(ctx context.Context, cfg PushConfig) error {
124
122
pushed = append (pushed , refInfo )
125
123
totalSize -= size
126
124
}
125
+ progress .Successf ("Pushed %d images" , len (cfg .ImageList ))
127
126
return nil
128
127
}, retry .Context (ctx ), retry .Attempts (uint (cfg .Retries )), retry .Delay (500 * time .Millisecond ))
129
128
if err != nil {
130
129
return err
131
130
}
132
131
133
- progress .Successf ("Pushed %d images" , len (cfg .ImageList ))
134
-
135
132
return nil
136
133
}
137
134
0 commit comments