From 13c9ae0de55adf90f7f360e73b401853d1d97212 Mon Sep 17 00:00:00 2001 From: Chandra Pamuluri Date: Wed, 24 Apr 2024 09:59:07 -0500 Subject: [PATCH] spinner --- go.mod | 1 + pkg/airgapped/plugin_bundle_upload.go | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5cfd8fa65..ecfd2a03b 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/vmware-tanzu/tanzu-cli go 1.21 replace cloud.google.com/go => cloud.google.com/go v0.102.1 + replace github.com/vmware-tanzu/tanzu-cli/test/e2e/framework => ./test/e2e/framework require ( diff --git a/pkg/airgapped/plugin_bundle_upload.go b/pkg/airgapped/plugin_bundle_upload.go index 3cb549ea3..df0dc2e45 100644 --- a/pkg/airgapped/plugin_bundle_upload.go +++ b/pkg/airgapped/plugin_bundle_upload.go @@ -7,6 +7,7 @@ import ( "fmt" "os" "path/filepath" + "time" "github.com/pkg/errors" @@ -67,9 +68,10 @@ func (o *UploadPluginBundleOptions) UploadPluginBundle() error { if err != nil { return errors.Wrap(err, "error while constructing the repo image path") } - if err = o.uploadImage(imageTar, repoImagePath, totalImages, imagesUploaded); err != nil { - return err + if uploadErr := o.uploadImage(imageTar, repoImagePath, totalImages, imagesUploaded); uploadErr != nil { + return uploadErr } + time.Sleep(3 * time.Second) imagesUploaded++ } log.Infof("---------------------------") @@ -130,7 +132,6 @@ func (o *UploadPluginBundleOptions) uploadImage(imageTar, repoImagePath string, uploadedMsg = fmt.Sprintf(uploadedMsg, totalImages, imagesUploaded+1, repoImagePath) if spinner != nil { spinner.SetFinalText(uploadedMsg, log.LogTypeINFO) - spinner.StopSpinner() } else { log.Infof(uploadedMsg, totalImages, imagesUploaded, repoImagePath) }