Skip to content

Commit

Permalink
cloud: temporary stop progress before uploading
Browse files Browse the repository at this point in the history
The upload code is currently using a plain "pb.ProgressBar" and
this is tested as part of our integration test. This will collide
with our own progress implementation. For now workaround this by
stopping our own progress and let plain "pb" takeover.

I was tempted to fix it right away but the PR with the progress
is already relatively big so I opted for a followup.
  • Loading branch information
mvo5 committed Dec 19, 2024
1 parent b145f1e commit 8f3ca27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bib/cmd/bootc-image-builder/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func uploadAMI(path, targetArch string, flags *pflag.FlagSet) error {
// similar. Eventually we may provide json progress here too.
var pbar *pb.ProgressBar
switch progress {
case "text":
case "", "plain", "term":
pbar = pb.New(0)
}

Expand Down
5 changes: 5 additions & 0 deletions bib/cmd/bootc-image-builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,11 @@ func cmdBuild(cmd *cobra.Command, args []string) error {

pbar.SetMessagef("Build complete!")
if upload {
// XXX: pass our own progress.ProgressBar here
// *for now* just stop our own progress and let the uploadAMI
// progress take over - but we really need to fix this in a
// followup
pbar.Stop()
for idx, imgType := range imgTypes {
switch imgType {
case "ami":
Expand Down

0 comments on commit 8f3ca27

Please sign in to comment.