fix: retry manifest reads from URLs on transient network errors - #10958
annaveretennykova wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @annaveretennykova. Thanks for your PR. I'm waiting for a aws member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Issue #: #4194
Description of changes:
Manifest reads from URLs in
pkg/files/reader.gohad no retry, so a single transient network error (for example a DNSi/o timeout) failed the whole operation. This wraps the HTTP GET and body read inreadHttpFilewith the existingpkg/retrier, so transient failures are retried instead of aborting the command. TheReadergets aretrierfield defaulted toretrier.NewWithMaxRetries(5, 5*time.Second)inNewReader, plus aWithRetrieroption for tests to inject a custom retrier. Only the network round trip is retried; request construction and local/embedded file reads are unchanged, and the existing error message is preserved.This covers both failure paths in the issue (cluster upgrade and cluster delete), since both go through
readHttpFile.Testing:
Added two unit tests in
pkg/files/reader_test.gousing a TLS test server that closes the connection to simulate a transient error:go build ./pkg/files/...,go vet ./pkg/files/...,gofmt -l pkg/files/, andgo test ./pkg/files/...all pass.Documentation:
None. Internal behavior change with no user-facing configuration or API surface.