fix: handle NotFound and add ownerReferences in BarePodManager#322
fix: handle NotFound and add ownerReferences in BarePodManager#322tremes wants to merge 2 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (8)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughChangesBare-pod sandbox lifecycle
Sequence Diagram(s)sequenceDiagram
participant SandboxAgentCaller
participant BarePodManager
participant KubernetesAPI
SandboxAgentCaller->>BarePodManager: Claim(ctx, run, step, "")
BarePodManager->>KubernetesAPI: Create Pod with AgenticRun ownerReference
SandboxAgentCaller->>BarePodManager: WaitReady()
BarePodManager->>KubernetesAPI: Get Pod
KubernetesAPI-->>BarePodManager: Ready or terminal lifecycle state
BarePodManager-->>SandboxAgentCaller: Ready or error
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@controller/agenticrun/bare_pod_manager.go`:
- Around line 63-67: Remove mutable owner state from BarePodManager by
eliminating SetOwner and the m.run dependency; change Claim to accept the owning
AgenticRun explicitly and use that argument when constructing the pod
ownerReference. Update all Claim callers, including SandboxAgentCaller, to pass
the reconcile-specific run so concurrent reconciles cannot attach pods to the
wrong owner.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 439a5b81-0f6a-4beb-8a84-4643f83f599a
📒 Files selected for processing (6)
.ai/spec/how/reconciler.md.ai/spec/what/sandbox-execution.mdcontroller/agenticrun/bare_pod_manager.gocontroller/agenticrun/bare_pod_manager_test.gocontroller/agenticrun/sandbox.gocontroller/agenticrun/sandbox_agent.go
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
openshift/lightspeed-agentic-sandbox(manual)
WaitReady now treats NotFound as a terminal error instead of polling until timeout. It also checks DeletionTimestamp after a successful Get to fail fast on terminating pods. Sandbox pods created by Claim now carry ownerReferences back to the AgenticRun via the new SandboxOwnerSetter optional interface, enabling garbage collection on AgenticRun deletion. Closes: openshift#301 Signed-off-by: Tomáš Remeš <tremes@redhat.com> Assisted-by: Claude Code:claude-opus-4-6
Remove SetOwner/SandboxOwnerSetter and pass *AgenticRun directly to SandboxProvider.Claim. The shared BarePodManager instance stored mutable owner state via SetOwner, so concurrent reconciles could attach a pod's ownerReference to the wrong AgenticRun. Claim now always sets ownerReferences from the passed-in run argument, eliminating the race window entirely. Signed-off-by: Tomáš Remeš <tremes@redhat.com> Assisted-by: Claude Code:claude-opus-4-6
|
@tremes: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
WaitReady now treats NotFound as a terminal error instead of polling until timeout. It also checks DeletionTimestamp after a successful Get to fail fast on terminating pods.
Sandbox pods created by Claim now carry ownerReferences back to the AgenticRun via the new SandboxOwnerSetter optional interface, enabling garbage collection on AgenticRun deletion.
Closes: #301
Assisted-by: Claude Code:claude-opus-4-6