Преглед на файлове

fix(agent): substitute namespace in runtime environment

The lambdagent template references $(metadata.namespace), but the Agent controller did not expose that placeholder in component variables. Pods therefore received an invalid agent ID containing the literal placeholder, and Remote Service rejected runs with HTTP 422.

- Add metadata.namespace to Agent component template variables
- Preserve existing agent name and UID substitution behavior
KongLingTT преди 1 месец
родител
ревизия
408017c549
променени са 1 файла, в които са добавени 4 реда и са изтрити 3 реда
  1. 4 3
      internal/controller/agent_controller.go

+ 4 - 3
internal/controller/agent_controller.go

@@ -148,9 +148,10 @@ func (r *AgentReconciler) reconcileComponent(ctx context.Context, agent *v1alpha
 		comp.Spec.Category = "Agent"
 		comp.Spec.Template = &tmpl
 		comp.Spec.Variables = map[string]string{
-			"systemPrompt": agent.Spec.SystemPrompt,
-			"agentName":    agent.Name,
-			"agentUid":     string(agent.UID),
+			"systemPrompt":       agent.Spec.SystemPrompt,
+			"agentName":          agent.Name,
+			"agentUid":           string(agent.UID),
+			"metadata.namespace": agent.Namespace,
 		}
 		comp.Spec.Dependencies = dependencies
 		if agent.Spec.StackRef != nil {