Skip to content

Commit

Permalink
Add progress bar for pulling Helm charts
Browse files Browse the repository at this point in the history
Signed-off-by: Atanas Dinov <atanas.dinov@suse.com>
  • Loading branch information
atanasdinov committed Jun 24, 2024
1 parent 7e4b60c commit f6fa243
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"path/filepath"
"strings"

"github.com/schollz/progressbar/v3"
"github.com/suse-edge/edge-image-builder/pkg/fileio"
"github.com/suse-edge/edge-image-builder/pkg/http"
"github.com/suse-edge/edge-image-builder/pkg/image"
Expand Down Expand Up @@ -110,6 +111,8 @@ func storeHelmCharts(ctx *image.Context, helmClient helmClient) ([]*helmChart, e
return nil, nil
}

bar := progressbar.Default(int64(len(helm.Charts)), "Pulling selected Helm charts...")

helmDir := filepath.Join(ctx.BuildDir, "helm")
if err := os.MkdirAll(helmDir, os.ModePerm); err != nil {
return nil, fmt.Errorf("creating helm directory: %w", err)
Expand All @@ -136,6 +139,8 @@ func storeHelmCharts(ctx *image.Context, helmClient helmClient) ([]*helmChart, e
localPath: localPath,
repositoryURL: repository.URL,
})

_ = bar.Add(1)
}

return charts, nil
Expand Down

0 comments on commit f6fa243

Please sign in to comment.