Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Send more workflow info to plugins. Fixes #8573 #8575

Closed
wants to merge 10 commits into from
6 changes: 5 additions & 1 deletion cmd/argoexec/commands/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ func initAgentExecutor() *executor.AgentExecutor {
if !ok {
log.Fatalf("Unable to determine workflow name from environment variable %s", common.EnvVarWorkflowName)
}
workflowUid, ok := os.LookupEnv(common.EnvVarWorkflowUID)
if !ok {
log.Warn("Unable to determine workflow Uid from environment variable %s", common.EnvVarWorkflowUID)
}

addresses := getPluginAddresses()
names := getPluginNames()
Expand All @@ -120,5 +124,5 @@ func initAgentExecutor() *executor.AgentExecutor {
plugins = append(plugins, rpc.New(address, string(data)))
}

return executor.NewAgentExecutor(clientSet, restClient, config, namespace, workflowName, plugins)
return executor.NewAgentExecutor(clientSet, restClient, config, namespace, workflowName, workflowUid, plugins)
}
4 changes: 3 additions & 1 deletion pkg/plugins/executor/objectmeta.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package executor

type ObjectMeta struct {
Name string `json:"name"`
Name string `json:"name"`
Namespace string `json:"namespace"`
Uid string `json:"uid"`
}
2 changes: 2 additions & 0 deletions workflow/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ const (
EnvVarInstanceID = "ARGO_INSTANCE_ID"
// EnvVarWorkflowName is the name of the workflow for which the an agent is responsible for
EnvVarWorkflowName = "ARGO_WORKFLOW_NAME"
// EnvVarWorkflowUID is the workflow UUID
EnvVarWorkflowUID = "ARGO_WORKFLOW_UID"
// EnvVarNodeID is the node ID of the node.
EnvVarNodeID = "ARGO_NODE_ID"
// EnvVarPluginAddresses is a list of plugin addresses
Expand Down