Skip to content

fix: retry manifest reads from URLs on transient network errors - #10958

Open
annaveretennykova wants to merge 1 commit into
aws:mainfrom
annaveretennykova:fix-4194-retry-manifest-fetch
Open

annaveretennykova wants to merge 1 commit into
aws:mainfrom
annaveretennykova:fix-4194-retry-manifest-fetch

Conversation

@annaveretennykova

Copy link
Copy Markdown

Issue #: #4194

Description of changes:

Manifest reads from URLs in pkg/files/reader.go had no retry, so a single transient network error (for example a DNS i/o timeout) failed the whole operation. This wraps the HTTP GET and body read in readHttpFile with the existing pkg/retrier, so transient failures are retried instead of aborting the command. The Reader gets a retrier field defaulted to retrier.NewWithMaxRetries(5, 5*time.Second) in NewReader, plus a WithRetrier option 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.go using a TLS test server that closes the connection to simulate a transient error:

  • retry then succeed on a later attempt, asserting the read succeeds and the expected number of attempts were made
  • fail after exhausting the configured retries, asserting an error is returned after the expected number of attempts

go build ./pkg/files/..., go vet ./pkg/files/..., gofmt -l pkg/files/, and go test ./pkg/files/... all pass.

Documentation:

None. Internal behavior change with no user-facing configuration or API surface.

@eks-distro-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign parlakisik for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@eks-distro-bot

Copy link
Copy Markdown
Collaborator

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@eks-distro-bot eks-distro-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants