Skip to content

Commit cf2dc75

Browse files
committed
docs: track SandboxClaim in rollback and clarify missing ports error
Signed-off-by: Abhinav Singh <abhinavsingh717073@gmail.com>
1 parent 42f7cf0 commit cf2dc75

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

docs/design/multi-agent-runtime-proposal.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ The environment variables injected into the dependent pod's containers point to
223223
* If `targetPort` is explicitly defined in the dependency's `RoleSpec` (either as a port name or number), that port is used as the default.
224224
* If `targetPort` is not specified, and the dependency's `AgentRuntime` CRD defines a single port, that port is used.
225225
* If `targetPort` is not specified, and it defines multiple ports, the system first looks for a port named `http` or `default`. If no such port is found, it falls back to the first port in the ports list.
226-
* If `targetPort` is not specified and the dependency's `AgentRuntime` CRD defines **no ports**, endpoint injection is skipped for that dependency and `injectDependencyEndpoints()` returns an error. The `ValidatingAdmissionWebhook` should reject at admission time any role that lists a dependency whose referenced `AgentRuntime` exposes no ports, preventing this error from reaching the creation path.
226+
* If `targetPort` is not specified and the dependency's `AgentRuntime` CRD defines **no ports**, endpoint injection fails and `injectDependencyEndpoints()` returns an error, which in turn causes the entire group creation to fail (triggering a full rollback under `Atomic` policy). The `ValidatingAdmissionWebhook` should reject at admission time any role that lists a dependency whose referenced `AgentRuntime` exposes no ports, preventing this error from reaching the creation path.
227227
228228
2. **Named Port Endpoints (For multi-service agents exposing multiple ports):**
229229
If the dependency's `AgentRuntime` CRD defines named ports, an endpoint environment variable is additionally injected for each named port:
@@ -278,12 +278,13 @@ agentgroup:{grp-xxx} -> AgentGroupManifest{
278278
279279
```go
280280
type createdRole struct {
281-
name string
282-
resp *types.CreateSandboxResponse
283-
sandbox *sandboxv1alpha1.Sandbox
284-
sessionID string
285-
serviceDNS string // stable DNS from the Headless Service (e.g., mar-abc-planner.ns.svc.cluster.local)
286-
failed bool
281+
name string
282+
resp *types.CreateSandboxResponse
283+
sandbox *sandboxv1alpha1.Sandbox
284+
sandboxClaim *extensionsv1alpha1.SandboxClaim
285+
sessionID string
286+
serviceDNS string // stable DNS from the Headless Service (e.g., mar-abc-planner.ns.svc.cluster.local)
287+
failed bool
287288
}
288289
289290
func (s *Server) createSandboxGroup(
@@ -308,7 +309,7 @@ func (s *Server) createSandboxGroup(
308309
if c.failed {
309310
continue
310311
}
311-
s.rollbackSandboxCreation(dynamicClient, c.sandbox, nil, c.sessionID)
312+
s.rollbackSandboxCreation(dynamicClient, c.sandbox, c.sandboxClaim, c.sessionID)
312313
}
313314
// Clean up any Headless Services created during group setup.
314315
for _, svcName := range createdServices {
@@ -414,12 +415,13 @@ func (s *Server) createSandboxGroup(
414415
415416
createdMutex.Lock()
416417
created = append(created, createdRole{
417-
name: role.Name,
418-
resp: resp,
419-
sandbox: sandbox,
420-
sessionID: sandboxEntry.SessionID,
421-
serviceDNS: svcDNS,
422-
failed: false,
418+
name: role.Name,
419+
resp: resp,
420+
sandbox: sandbox,
421+
sandboxClaim: sandboxClaim,
422+
sessionID: sandboxEntry.SessionID,
423+
serviceDNS: svcDNS,
424+
failed: false,
423425
})
424426
createdMutex.Unlock()
425427
return nil

0 commit comments

Comments
 (0)