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

fix: improve feedback to user when submitting a workflow from the CLI w/o a serviceaccount specified #7246

Conversation

bennycornelissen
Copy link
Contributor

What was the issue?
When submitting a workflow using argo submit somefile.yaml, if the workflow does not explicitly specify a spec.serviceAccountName, the output of the command would look like this:

❯ argo submit workflow-artifact-repo-ref-test.yaml
Name:                artifactory-repository-ref-vp472
Namespace:           argo
ServiceAccount:      default
Status:              Pending
Created:             Thu Nov 18 15:24:57 +0100 (now)
Progress:

The important bit here is the ServiceAccount: default bit. In my case, I have configured a default ServiceAccount in the workflowDefaults section of the workflow-controller configmap. This means that my workflow will not run with ServiceAccount: default, but with the ServiceAccount I specified there. See the command below:

❯ argo get @latest
Name:                artifactory-repository-ref-vp472
Namespace:           argo
ServiceAccount:      argo-default-workflow
Status:              Succeeded
Conditions:
 PodRunning          False
 Completed           True

What did I change?
I changed the string that is returned as the value for serviceaccount when no serviceaccount is set. Instead of suggesting the workflow is using the default serviceaccount, it now specifies that no serviceaccount has been set, and we're using a default ServiceAccount instead.

Further context
This PR is the result of a Slack discussion between myself and @crenshaw-dev on this particular issue.

@bennycornelissen bennycornelissen changed the title improve feedback to user when submitting a workflow from the CLI w/o a serviceaccount specified fix: improve feedback to user when submitting a workflow from the CLI w/o a serviceaccount specified Nov 18, 2021
@bennycornelissen bennycornelissen force-pushed the feature/improve_handling_of_unset_serviceaccount_on_wf_submit branch 2 times, most recently from d1029be to 32a3cf7 Compare November 18, 2021 15:23
cmd/argo/commands/archive/get.go Outdated Show resolved Hide resolved
…erviceaccount specified

Signed-off-by: Benny Cornelissen <mail@bennycornelissen.nl>
@bennycornelissen bennycornelissen force-pushed the feature/improve_handling_of_unset_serviceaccount_on_wf_submit branch from 32a3cf7 to 0f60af3 Compare November 18, 2021 15:27
Copy link
Member

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I have any actual permissions in this org, but approved, lgtm. 😄

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for tracking it down! I'll wait for others to see if there's any concern about the change.

@simster7 simster7 merged commit 0ea8554 into argoproj:master Nov 19, 2021
@bennycornelissen bennycornelissen deleted the feature/improve_handling_of_unset_serviceaccount_on_wf_submit branch November 21, 2021 18:43
@sarabala1979 sarabala1979 mentioned this pull request Dec 15, 2021
73 tasks
@sarabala1979 sarabala1979 mentioned this pull request Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants