fix(orchestrator): make ttlSecondsAfterFinished optional to prevent GitOps reconciliation loops#418
Conversation
…itOps reconciliation loops When managed by ArgoCD or similar reconcilers, the TTL controller deletes the finished Job, causing drift detection and an infinite recreate-rerun cycle. Default to nil (omit the field) so the Job stays inert after completion; users who want auto-cleanup can explicitly set dbCreationJobTTLSecondsAfterFinished to a positive value. Assisted-by: Claude
Code Review by Qodo
1. TTL schema rejects zero
|
Review Summary by QodoMake ttlSecondsAfterFinished optional for GitOps compatibility
WalkthroughsDescription• Make ttlSecondsAfterFinished optional to prevent GitOps reconciliation loops • Default changed from 300 to nil (field omitted from Job spec) • Users can explicitly set positive value for auto-cleanup if needed • Updated documentation and schema to reflect optional behavior Diagramflowchart LR
A["Job with TTL=300"] -->|"Causes infinite loop"| B["TTL controller deletes Job"]
B -->|"ArgoCD detects drift"| C["Job recreated, script re-runs"]
C -->|"Loop continues"| A
D["Job without TTL field"] -->|"Recommended default"| E["Job stays inert after completion"]
F["Explicit TTL value set"] -->|"Optional cleanup"| G["Job auto-deleted after TTL"]
File Changes1. charts/backstage/Chart.yaml
|
…e with values.yaml Assisted-by: Claude
Kubernetes does not enforce a maximum on backoffLimit. Assisted-by: Claude
|
|
/cc @Fortune-Ndlovu Followup to #407 |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 091a9b0 |
3c3b2e8
into
redhat-developer:main



Description of the change
When the chart is managed by a continuous reconciler (e.g., ArgoCD), the
ttlSecondsAfterFinishedfield on thecreate-sf-dbJob causes an infinite reconciliation loop: the Job finishes, the TTL controller deletes it after 300s, ArgoCD detects drift and recreates it, causing the DB creation script to re-run endlessly.This PR makes
ttlSecondsAfterFinishedconditional; it is only rendered when explicitly set to a positive value. Users who want auto-cleanup can explicitly setorchestrator.sonataflowPlatform.dbCreationJobTTLSecondsAfterFinishedto a positive integer.Which issue(s) does this PR fix or relate to
How to test changes / Special notes to the reviewer
Checklist
Chart.yamlaccording to Semantic Versioning.values.yamland added to the corresponding README.md. The pre-commit utility can be used to generate the necessary content. Runpre-commit run --all-filesto run the hooks and then push any resulting changes. The pre-commit Workflow will enforce this and warn you if needed.pre-commithook.ct lintcommand.