Skip to content

Commit cb2c5ee

Browse files
feat: add retry with exponential backoff for transient registry errors
Add tenacity-based retry logic to get_rpmdb() and inspect_image_ref() so that transient HTTP errors from registries (502, 503, 429, connection resets, DNS failures) are retried automatically instead of failing the pipeline. - Retry up to 4 attempts with exponential backoff (5-60s) and jitter - Only retry on transient errors; permanent errors fail immediately - Log retry attempts to stderr for visibility in Tekton task logs - Add tenacity dependency to pyproject.toml and Pipfile - Add comprehensive tests for retry behavior and error classification - Update .gitignore for __pycache__ and uv.lock Assisted-by: Claude Code (Claude Opus 4.6) Signed-off-by: Ernesto González <ergonzal@redhat.com>
1 parent a276921 commit cb2c5ee

File tree

6 files changed

+289
-64
lines changed

6 files changed

+289
-64
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*.egg-info
2+
__pycache__/
3+
uv.lock

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pylint-pytest = "*"
2121
authlib = "*"
2222
kubernetes = "*"
2323
pytest-cov = "*"
24+
tenacity = "*"
2425

2526
[dev-packages]
2627
pytest = "*"

Pipfile.lock

Lines changed: 63 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies = [
1616
"pyyaml",
1717
"odcs[client]",
1818
"kubernetes",
19+
"tenacity",
1920
]
2021

2122
[project.scripts]
@@ -36,3 +37,5 @@ target-version = ["py311"]
3637

3738
[tool.pylint]
3839
load-plugins = ["pylint_pytest"]
40+
41+

0 commit comments

Comments
 (0)