Skip to content

Commit 4df65ba

Browse files
arvindk-softwaredevtekton-robot
authored andcommitted
feat: support structured JSON/YAML output for bulk delete operations
Extend -o json/yaml support to bulk delete scenarios across task, pipeline, pipelinerun, eventlistener, triggerbinding, triggertemplate, and clustertriggerbinding delete commands. Signed-off-by: Arvind Krishnamurthy <arvkrish@redhat.com> Assisted-by: Grok 4.7 (via Cursor)
1 parent fa82032 commit 4df65ba

28 files changed

Lines changed: 947 additions & 62 deletions

‎docs/cmd/tkn_clustertriggerbinding_delete.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ Delete a ClusterTriggerBinding and print the result as YAML:
3232

3333
tkn clustertriggerbinding delete foo -o yaml
3434

35+
Delete all ClusterTriggerBindings and print the result as JSON:
36+
37+
tkn clustertriggerbinding delete --all -o json
38+
39+
Delete all ClusterTriggerBindings and print the result as YAML:
40+
41+
tkn clustertriggerbinding delete --all -o yaml
42+
3543
Using -o json or -o yaml skips the confirmation prompt.
3644

3745

‎docs/cmd/tkn_eventlistener_delete.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ Delete an EventListener and print the result as YAML:
3232

3333
tkn eventlistener delete foo -n quux -o yaml
3434

35+
Delete all EventListeners in a namespace and print the result as JSON:
36+
37+
tkn eventlistener delete --all -n quux -o json
38+
39+
Delete all EventListeners in a namespace and print the result as YAML:
40+
41+
tkn eventlistener delete --all -n quux -o yaml
42+
3543
Using -o json or -o yaml skips the confirmation prompt.
3644

3745

‎docs/cmd/tkn_pipeline_delete.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ Delete a Pipeline and print the result as YAML:
3232

3333
tkn pipeline delete foo -n quux -o yaml
3434

35+
Delete all Pipelines in a namespace and print the result as JSON:
36+
37+
tkn pipeline delete --all -n quux -o json
38+
39+
Delete all Pipelines in a namespace and print the result as YAML:
40+
41+
tkn pipeline delete --all -n quux -o yaml
42+
43+
Delete a Pipeline and its PipelineRuns and print the result as JSON:
44+
45+
tkn pipeline delete foo -n quux --prs -o json
46+
47+
Delete a Pipeline and its PipelineRuns and print the result as YAML:
48+
49+
tkn pipeline delete foo -n quux --prs -o yaml
50+
3551
Using -o json or -o yaml skips the confirmation prompt.
3652

3753

‎docs/cmd/tkn_pipelinerun_delete.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,30 @@ Delete a PipelineRun and print the result as YAML:
3232

3333
tkn pipelinerun delete foo -n quux -o yaml
3434

35+
Delete all PipelineRuns in a namespace and print the result as JSON:
36+
37+
tkn pipelinerun delete --all -n quux -o json
38+
39+
Delete all PipelineRuns in a namespace and print the result as YAML:
40+
41+
tkn pipelinerun delete --all -n quux -o yaml
42+
43+
Delete all but the 2 most recent PipelineRuns and print the result as JSON:
44+
45+
tkn pipelinerun delete --keep 2 -n quux -o json
46+
47+
Delete all but the 2 most recent PipelineRuns and print the result as YAML:
48+
49+
tkn pipelinerun delete --keep 2 -n quux -o yaml
50+
51+
Delete PipelineRuns for a Pipeline and print the result as JSON:
52+
53+
tkn pipelinerun delete --pipeline foo -n quux -o json
54+
55+
Delete PipelineRuns for a Pipeline and print the result as YAML:
56+
57+
tkn pipelinerun delete --pipeline foo -n quux -o yaml
58+
3559
Using -o json or -o yaml skips the confirmation prompt.
3660

3761

‎docs/cmd/tkn_task_delete.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ Delete a Task and print the result as YAML:
3232

3333
tkn task delete foo -n quux -o yaml
3434

35+
Delete all Tasks in a namespace and print the result as JSON:
36+
37+
tkn task delete --all -n quux -o json
38+
39+
Delete all Tasks in a namespace and print the result as YAML:
40+
41+
tkn task delete --all -n quux -o yaml
42+
43+
Delete a Task and its TaskRuns and print the result as JSON:
44+
45+
tkn task delete foo -n quux --trs -o json
46+
47+
Delete a Task and its TaskRuns and print the result as YAML:
48+
49+
tkn task delete foo -n quux --trs -o yaml
50+
3551
Using -o json or -o yaml skips the confirmation prompt.
3652

3753

‎docs/cmd/tkn_triggerbinding_delete.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ Delete a TriggerBinding and print the result as YAML:
3232

3333
tkn triggerbinding delete foo -n quux -o yaml
3434

35+
Delete all TriggerBindings in a namespace and print the result as JSON:
36+
37+
tkn triggerbinding delete --all -n quux -o json
38+
39+
Delete all TriggerBindings in a namespace and print the result as YAML:
40+
41+
tkn triggerbinding delete --all -n quux -o yaml
42+
3543
Using -o json or -o yaml skips the confirmation prompt.
3644

3745

‎docs/cmd/tkn_triggertemplate_delete.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ Delete a TriggerTemplate and print the result as YAML:
3232

3333
tkn triggertemplate delete foo -n quux -o yaml
3434

35+
Delete all TriggerTemplates in a namespace and print the result as JSON:
36+
37+
tkn triggertemplate delete --all -n quux -o json
38+
39+
Delete all TriggerTemplates in a namespace and print the result as YAML:
40+
41+
tkn triggertemplate delete --all -n quux -o yaml
42+
3543
Using -o json or -o yaml skips the confirmation prompt.
3644

3745

‎docs/man/man1/tkn-clustertriggerbinding-delete.1‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,30 @@ tkn clustertriggerbinding delete foo \-o yaml
9999
.fi
100100
.RE
101101

102+
.PP
103+
Delete all ClusterTriggerBindings and print the result as JSON:
104+
105+
.PP
106+
.RS
107+
108+
.nf
109+
tkn clustertriggerbinding delete \-\-all \-o json
110+
111+
.fi
112+
.RE
113+
114+
.PP
115+
Delete all ClusterTriggerBindings and print the result as YAML:
116+
117+
.PP
118+
.RS
119+
120+
.nf
121+
tkn clustertriggerbinding delete \-\-all \-o yaml
122+
123+
.fi
124+
.RE
125+
102126
.PP
103127
Using \-o json or \-o yaml skips the confirmation prompt.
104128

‎docs/man/man1/tkn-eventlistener-delete.1‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,30 @@ tkn eventlistener delete foo \-n quux \-o yaml
103103
.fi
104104
.RE
105105

106+
.PP
107+
Delete all EventListeners in a namespace and print the result as JSON:
108+
109+
.PP
110+
.RS
111+
112+
.nf
113+
tkn eventlistener delete \-\-all \-n quux \-o json
114+
115+
.fi
116+
.RE
117+
118+
.PP
119+
Delete all EventListeners in a namespace and print the result as YAML:
120+
121+
.PP
122+
.RS
123+
124+
.nf
125+
tkn eventlistener delete \-\-all \-n quux \-o yaml
126+
127+
.fi
128+
.RE
129+
106130
.PP
107131
Using \-o json or \-o yaml skips the confirmation prompt.
108132

‎docs/man/man1/tkn-pipeline-delete.1‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,54 @@ tkn pipeline delete foo \-n quux \-o yaml
107107
.fi
108108
.RE
109109

110+
.PP
111+
Delete all Pipelines in a namespace and print the result as JSON:
112+
113+
.PP
114+
.RS
115+
116+
.nf
117+
tkn pipeline delete \-\-all \-n quux \-o json
118+
119+
.fi
120+
.RE
121+
122+
.PP
123+
Delete all Pipelines in a namespace and print the result as YAML:
124+
125+
.PP
126+
.RS
127+
128+
.nf
129+
tkn pipeline delete \-\-all \-n quux \-o yaml
130+
131+
.fi
132+
.RE
133+
134+
.PP
135+
Delete a Pipeline and its PipelineRuns and print the result as JSON:
136+
137+
.PP
138+
.RS
139+
140+
.nf
141+
tkn pipeline delete foo \-n quux \-\-prs \-o json
142+
143+
.fi
144+
.RE
145+
146+
.PP
147+
Delete a Pipeline and its PipelineRuns and print the result as YAML:
148+
149+
.PP
150+
.RS
151+
152+
.nf
153+
tkn pipeline delete foo \-n quux \-\-prs \-o yaml
154+
155+
.fi
156+
.RE
157+
110158
.PP
111159
Using \-o json or \-o yaml skips the confirmation prompt.
112160

0 commit comments

Comments
 (0)