fix(chartvalidator): manifest retrieval retry mechanism#20
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the chartvalidator image’s chart-checker pipeline by making Docker image existence validation more resilient to transient failures, and by expanding the project documentation and unit tests.
Changes:
- Added retry/backoff behavior around
docker manifest inspectin the Docker image validation engine. - Made the Docker validation engine more testable by injecting a sleep function (wired to
time.Sleepin production). - Rewrote/expanded
chartvalidator/README.mdwith a detailed pipeline and usage guide, and added unit tests for the retry behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
chartvalidator/README.md |
Expanded documentation describing the 5-stage pipeline, flags, registry auth, schema updates, and build instructions (includes retry behavior description). |
chartvalidator/checker/engine_docker_validation.go |
Implemented retry + randomized backoff for docker manifest inspect, and added injectable sleep function support. |
chartvalidator/checker/engine_docker_validation_test.go |
Added unit tests covering “eventual success after retries” and “failure after retries exhausted”. |
chartvalidator/checker/engine_app_checker.go |
Wires retrySleepFn to time.Sleep when constructing the Docker validation engine. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request significantly improves the robustness and clarity of the chart validation tool by adding retry logic for Docker image validation, enhancing documentation, and increasing test coverage. The main focus is on ensuring that transient network errors during Docker image validation do not cause unnecessary failures in CI, and that users and developers have a clear understanding of the tool's operation and capabilities.
Enhancements to Docker image validation:
docker manifest inspectfails due to a transient error, it will now retry up to three times with a randomized backoff between 1–15 seconds before marking the image as missing. This helps prevent CI failures due to temporary network issues.DockerImageValidationEngineto support injectable sleep functions, improving testability of the retry logic. [1] [2] [3]Test coverage improvements:
Documentation improvements:
README.mdwith a comprehensive overview of the tool, its pipeline stages, usage instructions, configuration flags, registry authentication, updating CRD schemas, and build instructions. This makes the project much more accessible to new users and contributors.