-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix file loss during download #10779
Fix file loss during download #10779
Conversation
Signed-off-by: bo.jiang <[email protected]>
973c5e1
to
44d6afe
Compare
You mean wget error code is only affected by the last file it fetches ? Checking it once does not work ? |
$ cat files.list
https://dl.k8s.io/release/v1.25.13/bin/linux/amd64/kubeadm
https://dl.k8s.io/release/v1.25.13/bin/linux/amd64/kubelet
https://dl.k8s.io/release/v1.25.13/bin/linux/amd64/kubectl
$ wget -x -P tmp -i files.list @VannTen For example, in this case, if I get an error while downloading a |
Ah ok ! I thought that you wanted "termination instead of masking the error", not "early termination" ^^.
The change makes more sense that way
/lgtm
|
Thanks @ErikJiang |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ErikJiang, yankay The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: bo.jiang <[email protected]>
What type of PR is this?
/kind bug
What this PR does / why we need it:
When using the
wget -i
command to download files, if a file fails to download during the process, the process will not exit. Instead, it will continue downloading the remaining URLs. This results in a problem where the downloaded content is missing the failed files.The following image is an example:
Furthermore, I haven't found any parameters in
wget -i
that would allow the process to be interrupted when an error occurs. Therefore, one approach is to iterate through each line infiles.list
and handle the download requests for each URL individually.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: