Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -32,7 +39,7 @@ func (s *GoWorkflowSubmitter) SubmitWorkflow(
InsecureSkipVerify: insecureSkipVerify,
},
AuthSupplier: func() string {
return apiKey
return argoBearerIfToken(apiKey)
},
})
if err != nil {
Expand Down
Loading