From 90d3a9c553b8075faf0becea1765bc79aaef28bb Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 18 Dec 2024 13:41:55 +0100 Subject: [PATCH] cloud: temporary stop progress before uploading 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. --- bib/cmd/bootc-image-builder/cloud.go | 2 +- bib/cmd/bootc-image-builder/main.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bib/cmd/bootc-image-builder/cloud.go b/bib/cmd/bootc-image-builder/cloud.go index 8b94b385..98de143b 100644 --- a/bib/cmd/bootc-image-builder/cloud.go +++ b/bib/cmd/bootc-image-builder/cloud.go @@ -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) } diff --git a/bib/cmd/bootc-image-builder/main.go b/bib/cmd/bootc-image-builder/main.go index 693d2382..9a5be5ea 100644 --- a/bib/cmd/bootc-image-builder/main.go +++ b/bib/cmd/bootc-image-builder/main.go @@ -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":