Skip to content

Commit

Permalink
fix: correct image download offset
Browse files Browse the repository at this point in the history
  • Loading branch information
hysyeah committed Dec 27, 2024
1 parent d608cf3 commit 6b4c794
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
15 changes: 1 addition & 14 deletions controllers/appmgr_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -970,20 +970,7 @@ func (r *ApplicationManagerController) pollDownloadProgress(ctx context.Context,
offset int64
total int64
}
maxImageSize := int64(0)

for _, nodeName := range im.Spec.Nodes {
for _, ref := range im.Spec.Refs {
size := im.Status.Conditions[nodeName][ref.Name]["total"]
if size == "" {
continue
}
total, _ := strconv.ParseInt(size, 10, 64)
if total > maxImageSize {
maxImageSize = total
}
}
}
maxImageSize := int64(50173680066)

nodeMap := make(map[string]*progress)
for _, nodeName := range im.Spec.Nodes {
Expand Down
2 changes: 1 addition & 1 deletion pkg/images/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func updateProgress(statuses []StatusInfo, ongoing *jobs, seen map[string]int64,
}
offset += status.Offset
}
if doneLayer == statusesLen {
if doneLayer == statusesLen && doneLayer != 0 {
offset = imageSize
}
if imageSize != 0 {
Expand Down

0 comments on commit 6b4c794

Please sign in to comment.