Skip to content

Commit 11cbcd4

Browse files
committed
feat: add tkn stepaction list, describe and delete
StepActions are a Tekton CRD like Tasks, but tkn had no commands for them. Add a stepaction command group with list, describe and delete, following the customrun commands for flags and output options. list shows name, description and age, sorted by namespace and name, with the usual -A, --label, --limit, --reverse, --no-headers and -o flags. describe shows the image, command, args, params and results. delete removes one or more StepActions and supports -o json|yaml. Fixes #2576 Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
1 parent 742db40 commit 11cbcd4

22 files changed

Lines changed: 1550 additions & 1 deletion

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ The following commands help you understand and effectively use the Tekton CLI:
220220
- [`tkn hub:`](docs/cmd/tkn_hub.md) Search and install Tekton Resources from [Hub](https://hub.tekton.dev)
221221
- [`tkn pipeline:`](docs/cmd/tkn_pipeline.md) Parent command of the Pipeline command group.
222222
- [`tkn pipelinerun:`](docs/cmd/tkn_pipelinerun.md) Parent command of the Pipelinerun command group.
223+
- [`tkn stepaction:`](docs/cmd/tkn_stepaction.md) Parent command of the StepAction command group.
223224
- [`tkn task:`](docs/cmd/tkn_task.md) Parent command of the Task command group.
224225
- [`tkn taskrun:`](docs/cmd/tkn_taskrun.md) Parent command of the Taskrun command group.
225226
- [`tkn triggerbinding:`](docs/cmd/tkn_triggerbinding.md) Parent command of the Triggerbinding command group.

‎docs/cmd/tkn.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ CLI for tekton pipelines
2828
* [tkn hub](tkn_hub.md) - Interact with artifacthub
2929
* [tkn pipeline](tkn_pipeline.md) - Manage pipelines
3030
* [tkn pipelinerun](tkn_pipelinerun.md) - Manage PipelineRuns
31+
* [tkn stepaction](tkn_stepaction.md) - Manage StepActions
3132
* [tkn task](tkn_task.md) - Manage Tasks
3233
* [tkn taskrun](tkn_taskrun.md) - Manage TaskRuns
3334
* [tkn triggerbinding](tkn_triggerbinding.md) - Manage TriggerBindings

‎docs/cmd/tkn_stepaction.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## tkn stepaction
2+
3+
Manage StepActions
4+
5+
***Aliases**: stepactions*
6+
7+
### Usage
8+
9+
```
10+
tkn stepaction
11+
```
12+
13+
### Synopsis
14+
15+
Manage StepActions
16+
17+
### Options
18+
19+
```
20+
-c, --context string name of the kubeconfig context to use (default: kubectl config current-context)
21+
-h, --help help for stepaction
22+
-k, --kubeconfig string kubectl config file (default: $HOME/.kube/config)
23+
-n, --namespace string namespace to use (default: from $KUBECONFIG)
24+
-C, --no-color disable coloring (default: false)
25+
```
26+
27+
### SEE ALSO
28+
29+
* [tkn](tkn.md) - CLI for tekton pipelines
30+
* [tkn stepaction delete](tkn_stepaction_delete.md) - Delete StepActions in a namespace
31+
* [tkn stepaction describe](tkn_stepaction_describe.md) - Describe a StepAction in a namespace
32+
* [tkn stepaction list](tkn_stepaction_list.md) - Lists StepActions in a namespace
33+

‎docs/cmd/tkn_stepaction_delete.md‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
## tkn stepaction delete
2+
3+
Delete StepActions in a namespace
4+
5+
***Aliases**: rm*
6+
7+
### Usage
8+
9+
```
10+
tkn stepaction delete
11+
```
12+
13+
### Synopsis
14+
15+
Delete StepActions in a namespace
16+
17+
### Examples
18+
19+
Delete StepAction with name 'foo' in namespace 'bar':
20+
21+
tkn stepaction delete foo -n bar
22+
23+
or
24+
25+
tkn stepaction rm foo -n bar
26+
27+
Delete a StepAction and print the result as JSON:
28+
29+
tkn stepaction delete foo -n bar -o json
30+
31+
Delete a StepAction and print the result as YAML:
32+
33+
tkn stepaction delete foo -n bar -o yaml
34+
35+
36+
### Options
37+
38+
```
39+
-h, --help help for delete
40+
-o, --output string Output format. One of: json|yaml
41+
```
42+
43+
### Options inherited from parent commands
44+
45+
```
46+
-c, --context string name of the kubeconfig context to use (default: kubectl config current-context)
47+
-k, --kubeconfig string kubectl config file (default: $HOME/.kube/config)
48+
-n, --namespace string namespace to use (default: from $KUBECONFIG)
49+
-C, --no-color disable coloring (default: false)
50+
```
51+
52+
### SEE ALSO
53+
54+
* [tkn stepaction](tkn_stepaction.md) - Manage StepActions
55+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
## tkn stepaction describe
2+
3+
Describe a StepAction in a namespace
4+
5+
***Aliases**: desc*
6+
7+
### Usage
8+
9+
```
10+
tkn stepaction describe
11+
```
12+
13+
### Synopsis
14+
15+
Describe a StepAction in a namespace
16+
17+
### Examples
18+
19+
Describe a StepAction of name 'foo' in namespace 'bar':
20+
21+
tkn stepaction describe foo -n bar
22+
23+
or
24+
25+
tkn stepaction desc foo -n bar
26+
27+
Describe a StepAction as JSON:
28+
29+
tkn stepaction describe foo -n bar -o json
30+
31+
Describe a StepAction as YAML:
32+
33+
tkn stepaction describe foo -n bar -o yaml
34+
35+
36+
### Options
37+
38+
```
39+
--allow-missing-template-keys If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true)
40+
-F, --fzf use fzf to select a StepAction to describe
41+
-h, --help help for describe
42+
--limit int lists number of StepActions when selecting a StepAction to describe (default 5)
43+
-o, --output string Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).
44+
--show-managed-fields If true, keep the managedFields when printing objects in JSON or YAML format.
45+
--template string Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
46+
```
47+
48+
### Options inherited from parent commands
49+
50+
```
51+
-c, --context string name of the kubeconfig context to use (default: kubectl config current-context)
52+
-k, --kubeconfig string kubectl config file (default: $HOME/.kube/config)
53+
-n, --namespace string namespace to use (default: from $KUBECONFIG)
54+
-C, --no-color disable coloring (default: false)
55+
```
56+
57+
### SEE ALSO
58+
59+
* [tkn stepaction](tkn_stepaction.md) - Manage StepActions
60+

‎docs/cmd/tkn_stepaction_list.md‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## tkn stepaction list
2+
3+
Lists StepActions in a namespace
4+
5+
***Aliases**: ls*
6+
7+
### Usage
8+
9+
```
10+
tkn stepaction list
11+
```
12+
13+
### Synopsis
14+
15+
Lists StepActions in a namespace
16+
17+
### Examples
18+
19+
List all StepActions in namespace 'bar':
20+
21+
tkn stepaction list -n bar
22+
23+
List StepActions as a JSON array:
24+
25+
tkn stepaction list -o json
26+
27+
List StepActions as a YAML array:
28+
29+
tkn stepaction list -o yaml
30+
31+
32+
### Options
33+
34+
```
35+
-A, --all-namespaces list StepActions from all namespaces
36+
--allow-missing-template-keys If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true)
37+
-h, --help help for list
38+
--label string A selector (label query) to filter on, supports '=', '==', and '!='
39+
--limit int Limits the number of StepActions. If the limit value is 0 returns all
40+
--no-headers do not print column headers with output (default print column headers with output)
41+
-o, --output string Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).
42+
--reverse list StepActions in reverse order
43+
--show-managed-fields If true, keep the managedFields when printing objects in JSON or YAML format.
44+
--template string Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
45+
```
46+
47+
### Options inherited from parent commands
48+
49+
```
50+
-c, --context string name of the kubeconfig context to use (default: kubectl config current-context)
51+
-k, --kubeconfig string kubectl config file (default: $HOME/.kube/config)
52+
-n, --namespace string namespace to use (default: from $KUBECONFIG)
53+
-C, --no-color disable coloring (default: false)
54+
```
55+
56+
### SEE ALSO
57+
58+
* [tkn stepaction](tkn_stepaction.md) - Manage StepActions
59+
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
.TH "TKN\-STEPACTION\-DELETE" "1" "" "Auto generated by spf13/cobra" ""
2+
.nh
3+
.ad l
4+
5+
6+
.SH NAME
7+
.PP
8+
tkn\-stepaction\-delete \- Delete StepActions in a namespace
9+
10+
11+
.SH SYNOPSIS
12+
.PP
13+
\fBtkn stepaction delete\fP
14+
15+
16+
.SH DESCRIPTION
17+
.PP
18+
Delete StepActions in a namespace
19+
20+
21+
.SH OPTIONS
22+
.PP
23+
\fB\-h\fP, \fB\-\-help\fP[=false]
24+
help for delete
25+
26+
.PP
27+
\fB\-o\fP, \fB\-\-output\fP=""
28+
Output format. One of: json|yaml
29+
30+
31+
.SH OPTIONS INHERITED FROM PARENT COMMANDS
32+
.PP
33+
\fB\-c\fP, \fB\-\-context\fP=""
34+
name of the kubeconfig context to use (default: kubectl config current\-context)
35+
36+
.PP
37+
\fB\-k\fP, \fB\-\-kubeconfig\fP=""
38+
kubectl config file (default: $HOME/.kube/config)
39+
40+
.PP
41+
\fB\-n\fP, \fB\-\-namespace\fP=""
42+
namespace to use (default: from $KUBECONFIG)
43+
44+
.PP
45+
\fB\-C\fP, \fB\-\-no\-color\fP[=false]
46+
disable coloring (default: false)
47+
48+
49+
.SH EXAMPLE
50+
.PP
51+
Delete StepAction with name 'foo' in namespace 'bar':
52+
53+
.PP
54+
.RS
55+
56+
.nf
57+
tkn stepaction delete foo \-n bar
58+
59+
.fi
60+
.RE
61+
62+
.PP
63+
or
64+
65+
.PP
66+
.RS
67+
68+
.nf
69+
tkn stepaction rm foo \-n bar
70+
71+
.fi
72+
.RE
73+
74+
.PP
75+
Delete a StepAction and print the result as JSON:
76+
77+
.PP
78+
.RS
79+
80+
.nf
81+
tkn stepaction delete foo \-n bar \-o json
82+
83+
.fi
84+
.RE
85+
86+
.PP
87+
Delete a StepAction and print the result as YAML:
88+
89+
.PP
90+
.RS
91+
92+
.nf
93+
tkn stepaction delete foo \-n bar \-o yaml
94+
95+
.fi
96+
.RE
97+
98+
99+
.SH SEE ALSO
100+
.PP
101+
\fBtkn\-stepaction(1)\fP

0 commit comments

Comments
 (0)