Skip to content

Commit

Permalink
fix: improve feedback when submitting a workflow from the CLI w/o a s…
Browse files Browse the repository at this point in the history
…erviceaccount specified (#7246)

Signed-off-by: Benny Cornelissen <mail@bennycornelissen.nl>
  • Loading branch information
bennycornelissen authored Nov 19, 2021
1 parent 8b530df commit 0ea8554
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmd/argo/commands/archive/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ func NewGetCommand() *cobra.Command {
fmt.Printf(fmtStr, "Namespace:", wf.ObjectMeta.Namespace)
serviceAccount := wf.Spec.ServiceAccountName
if serviceAccount == "" {
serviceAccount = "default"
// if serviceAccountName was not specified in a submitted Workflow, we will
// use the serviceAccountName provided in Workflow Defaults (if any). If that
// also isn't set, we will use the 'default' ServiceAccount in the namespace
// the workflow will run in.
serviceAccount = "unset (will run with the default ServiceAccount)"
}
fmt.Printf(fmtStr, "ServiceAccount:", serviceAccount)
fmt.Printf(fmtStr, "Status:", wf.Status.Phase)
Expand Down
6 changes: 5 additions & 1 deletion cmd/argo/commands/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ func printWorkflowHelper(wf *wfv1.Workflow, getArgs getFlags) string {
out += fmt.Sprintf(fmtStr, "Namespace:", wf.ObjectMeta.Namespace)
serviceAccount := wf.Spec.ServiceAccountName
if serviceAccount == "" {
serviceAccount = "default"
// if serviceAccountName was not specified in a submitted Workflow, we will
// use the serviceAccountName provided in Workflow Defaults (if any). If that
// also isn't set, we will use the 'default' ServiceAccount in the namespace
// the workflow will run in.
serviceAccount = "unset (will run with the default ServiceAccount)"
}
out += fmt.Sprintf(fmtStr, "ServiceAccount:", serviceAccount)
out += fmt.Sprintf(fmtStr, "Status:", printer.WorkflowStatus(wf))
Expand Down

0 comments on commit 0ea8554

Please sign in to comment.