Skip to content

Commit b6d9492

Browse files
committed
fix(workloadmanager): add comments to force CI build cache invalidation
The Docker build on CI uses --mount=type=cache for the Go build cache. Stale cache entries from a prior broken push were causing a phantom 'duplicate field name workloadName' error even though the source file was correct. Adding explanatory comments to the sandboxEntry literals in buildSandboxByAgentRuntime and buildSandboxByCodeInterpreter changes the file hash, forcing the Go toolchain to recompile the package from scratch and bypass the poisoned cache. The comments also document why WorkloadKind/WorkloadName are set here. Signed-off-by: KinshukSS2 <kinshuk380@gmail.com>
1 parent bd8b9a3 commit b6d9492

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

pkg/workloadmanager/workload_builder.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ func loadPublicKeyFromSecret(clientset kubernetes.Interface) error {
129129
return nil
130130
}
131131

132+
// buildSandboxParams holds all parameters needed to construct a Sandbox object.
133+
// workloadName carries the name of the AgentRuntime or CodeInterpreter template
134+
// that owns the sandbox, used to populate route-identity validation metadata.
132135
type buildSandboxParams struct {
133136
namespace string
134137
workloadName string
@@ -292,6 +295,8 @@ func buildSandboxByAgentRuntime(namespace string, name string, ifm *Informers) (
292295
}
293296
buildParams.idleTimeout = idleTimeout
294297
sandbox := buildSandboxObject(buildParams)
298+
// WorkloadKind and WorkloadName record the route-identity of the owning workload
299+
// so the router can validate session reuse against the correct target.
295300
entry := &sandboxEntry{
296301
Kind: types.SandboxKind,
297302
WorkloadKind: types.AgentRuntimeKind,
@@ -351,6 +356,8 @@ func buildSandboxByCodeInterpreter(namespace string, codeInterpreterName string,
351356
idleTimeout = codeInterpreterObj.Spec.SessionTimeout.Duration
352357
}
353358

359+
// WorkloadKind and WorkloadName record the route-identity of the owning workload
360+
// so the router can validate session reuse against the correct target.
354361
sandboxEntry := &sandboxEntry{
355362
Kind: types.SandboxKind,
356363
WorkloadKind: types.CodeInterpreterKind,

0 commit comments

Comments
 (0)