Skip to content

Commit acf56f9

Browse files
authored
feat(server): Label workflows with creator. Closes argoproj#2437 (argoproj#3440)
1 parent 3b8ac06 commit acf56f9

36 files changed

+927
-85
lines changed

api/openapi-spec/swagger.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,22 @@
674674
}
675675
}
676676
},
677+
"/api/v1/userinfo": {
678+
"get": {
679+
"tags": [
680+
"InfoService"
681+
],
682+
"operationId": "GetUserInfo",
683+
"responses": {
684+
"200": {
685+
"description": "A successful response.",
686+
"schema": {
687+
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.GetUserInfoResponse"
688+
}
689+
}
690+
}
691+
}
692+
},
677693
"/api/v1/version": {
678694
"get": {
679695
"tags": [
@@ -2349,6 +2365,17 @@
23492365
}
23502366
}
23512367
},
2368+
"io.argoproj.workflow.v1alpha1.GetUserInfoResponse": {
2369+
"type": "object",
2370+
"properties": {
2371+
"issuer": {
2372+
"type": "string"
2373+
},
2374+
"subject": {
2375+
"type": "string"
2376+
}
2377+
}
2378+
},
23522379
"io.argoproj.workflow.v1alpha1.GitArtifact": {
23532380
"description": "GitArtifact is the location of an git artifact",
23542381
"type": "object",

docs/access-token.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Create a service account for your service:
1414
kubectl create sa jenkins
1515
```
1616

17+
!! TIP
18+
Create a unique service account for each client: (a) you'll be able to correctly secure your workflows and (b) [revoke the token](#token-revocation) without impacting other clients.
19+
1720
Bind the service account to the role (in this case in the `argo` namespace):
1821

1922
```sh

docs/cli/argo_list.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ argo list [flags]
2222
--older string List completed workflows finished before the specified duration (e.g. 10m, 3h, 1d)
2323
-o, --output string Output format. One of: wide|name
2424
--prefix string Filter workflows by prefix
25+
--resubmitted Show only resubmitted workflows
2526
--running Show only running workflows
2627
-l, --selector string Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
2728
--since string Show only workflows created after than a relative duration

docs/workflow-creator.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# Workflow Creator
22

3-
Today, is not possible for Argo Workflows to determine who created a workflow.
3+
![alpha](assets/alpha.svg)
44

5-
The recommended approach is to add a label to your workflow, e.g.
5+
> v2.9 and after
66
7-
```
8-
argo submit -l creator=alex
9-
```
7+
If you create your workflow via the CLI or UI, an attempt will be made to label it with the user who created it
8+
9+
```yaml
10+
apiVersion: argoproj.io/v1alpha1
11+
kind: Workflow
12+
metadata:
13+
name: my-wf
14+
labels:
15+
workflows.argoproj.io/creator: admin
16+
```
17+
18+
!!! NOTE
19+
Labels only contain `[-_.0-9a-zA-Z]`, so any other characters will be turned into `-`.
20+

0 commit comments

Comments
 (0)