kube generate: write Job backoffLimit from restart retries #30404
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.68) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.68 · 442 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.365
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.068
Real PR Conversation Timeline
1 comments
"Review active on #30404"
general
weight: 0.35
ajoshua2004
@mheon requested on #30342.
kube generate --type jobalways writesrestartPolicy: Neverand nobackoffLimit, even for a container created with--restart on-failure:3. Since #30342,kube playhonoursbackoffLimit, so a generate and play round trip drops the retry bound.This writes the source's restart policy and retry count into the Job, the inverse of #30342:
on-failure:N, N > 0:restartPolicy: OnFailure,backoffLimit: Non-failurewith no count:OnFailure, nobackoffLimit. Podman storeson-failure:0the same way, so it maps here too.noor unset:Never, as beforealways: an error, as beforeFor a pod the pod's retry count is used. With several containers, the first container's count is used.
Where it differs from Kubernetes:
backoffLimit,kube playrestarts without limit, where Kubernetes defaults to 6. kubernetes_support.md now says so.Left as is: a pod with no restart policy of its own still generates
Never, even when its containers useon-failure.To reproduce:
podman create --restart on-failure:3 --name c alpine false, thenpodman kube generate --type job c. Main writesNeverand no limit. With this change it writesOnFailureandbackoffLimit: 3, and playing that YAML stops after 3 restarts.The new e2e table case in generate_kube_test.go and the round trip in 710-kube.bats fail on main and pass with the change. On the final tree:
Podman kube generate): 78 passed, 0 failed710-kube.bats(kube generate): 8 ok, 0 failedhack/golangci-lint.sh, base, systemd and remote tags): 0 issuesRun on podman main 4ad7ed5d6, rootless, Fedora 45.
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
<!-- Use [x] to mark as done, or click the checkbox after opening PR -->
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. Read the DCO Sign-off requirements
and ensure you follow them before signing off your commits.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?
``
release-note
``kube generate --type job now writes restartPolicy OnFailure and backoffLimit from the container's restart retries.