From b2faa42b6994d23dea5500a03b8023c4950ebb44 Mon Sep 17 00:00:00 2001 From: Michael Leone Date: Mon, 4 May 2026 16:27:45 -0400 Subject: [PATCH] fix(argo-workflows): fix bug with apiTokens * if there's an api token we need a Bearer with the token --- .../pkg/jobagents/argoworkflows/workflow_submitter.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/workspace-engine/pkg/jobagents/argoworkflows/workflow_submitter.go b/apps/workspace-engine/pkg/jobagents/argoworkflows/workflow_submitter.go index 5557317ff..e8ac3616e 100644 --- a/apps/workspace-engine/pkg/jobagents/argoworkflows/workflow_submitter.go +++ b/apps/workspace-engine/pkg/jobagents/argoworkflows/workflow_submitter.go @@ -18,6 +18,13 @@ import ( // that calls the Argo Workflows REST API. type GoWorkflowSubmitter struct{} +func argoBearerIfToken(token string) string { + if token == "" { + return "" + } + return "Bearer " + token +} + func (s *GoWorkflowSubmitter) SubmitWorkflow( ctx context.Context, serverAddr, apiKey string, @@ -32,7 +39,7 @@ func (s *GoWorkflowSubmitter) SubmitWorkflow( InsecureSkipVerify: insecureSkipVerify, }, AuthSupplier: func() string { - return apiKey + return argoBearerIfToken(apiKey) }, }) if err != nil {