Skip to content

Commit

Permalink
Fix bug where we warn of empty layers when progress bars are disabled
Browse files Browse the repository at this point in the history
When packing a ModelKit, we precompute the total size of files in each
layer so that we can show a progress bar for the pack process. However,
we assume we don't need this size when progress bars are disabled and
simply return a size of 0.

Since the computed size is also used in printing a warning about empty
layers, this leads to us printing a warning that layers are empty when
progress bars are disabled.
  • Loading branch information
amisevsk committed Feb 6, 2025
1 parent ad12d4a commit e63cbdc
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions pkg/lib/kitfile/layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,6 @@ func writeFileToTar(file string, fi os.FileInfo, ptw *output.ProgressTar, plog *
}

func getTotalSize(basePath string, ignore filesystem.IgnorePaths) (int64, error) {
if !output.ProgressEnabled() {
// Won't use this information anyways, save the work.
return 0, nil
}

pathInfo, err := os.Stat(basePath)
if err != nil {
if errors.Is(err, os.ErrNotExist) {
Expand Down

0 comments on commit e63cbdc

Please sign in to comment.