Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
🟡 Changes recommended
Interactive selection corrupts JSON/YAML output with stdout feedback, template-only requests are ignored, and deleting a missing resource returns the wrong exit code.
3 open issues
What changed in this PR
Adds StepAction management to tkn, addressing #2576 through the existing command tree and dynamic Kubernetes client.
Changes:
- Adds
stepaction list,describe, anddelete, with filtering, interactive selection, and structured output. - Adds command tests and shared StepAction test helpers.
- Updates command references, man pages, and root help output.
| File | Description |
|---|---|
| README.md | Links the StepAction command reference. |
| pkg/test/dynamic/dynamictestclient.go | Registers StepAction lists in the fake client. |
| pkg/test/builder/unstructured.go | Adds an unstructured StepAction builder. |
| pkg/options/resource_names.go | Defines the StepAction resource name. |
| pkg/options/describe.go | Supports StepAction selection. |
| pkg/cmd/testdata/TestPluginList.golden | Adds StepAction to expected root help. |
| pkg/cmd/stepaction/stepaction.go | Defines the command group and resource endpoint. |
| pkg/cmd/stepaction/stepaction_test.go | Tests listing, description, and deletion. |
| pkg/cmd/stepaction/list.go | Implements listing, sorting, filtering, and output. |
| pkg/cmd/stepaction/describe.go | Implements selection and detailed resource output. |
| pkg/cmd/stepaction/delete.go | Implements deletion and structured results. |
| pkg/cmd/root.go | Registers the StepAction command group. |
| docs/man/man1/tkn.1 | Links the StepAction man page. |
| docs/man/man1/tkn-stepaction.1 | Documents the command group. |
| docs/man/man1/tkn-stepaction-list.1 | Documents listing flags and examples. |
| docs/man/man1/tkn-stepaction-describe.1 | Documents description flags and examples. |
| docs/man/man1/tkn-stepaction-delete.1 | Documents deletion flags and examples. |
| docs/cmd/tkn.md | Links the StepAction command reference. |
| docs/cmd/tkn_stepaction.md | Documents the command group. |
| docs/cmd/tkn_stepaction_list.md | Documents listing usage and options. |
| docs/cmd/tkn_stepaction_describe.md | Documents description usage and options. |
| docs/cmd/tkn_stepaction_delete.md | Documents deletion usage and options. |
Review effort: Balanced
| case ResourceNameStepAction: | ||
| opts.StepActionName = ans |
| if !errors.IsNotFound(err) { | ||
| return err | ||
| } | ||
| return fmt.Errorf("StepAction %s not found in namespace %s", name, namespace) |
There was a problem hiding this comment.
Fixed in 024379b, a missing StepAction now exits with NotFound and keeps the API error wrapped. The delete test checks the code.
| } | ||
| } | ||
| return nil | ||
| } else if output != "" { |
There was a problem hiding this comment.
Leaving this as is for now. task and pipeline list/describe only print the template with -o too, so stepaction matches them. If we want --template alone to work it's better fixed for all of them in one PR.
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 tektoncd#2576 Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
11cbcd4 to
3acc74e
Compare
The selected name was written to stdout, which broke -o json and -o yaml output when picking from several resources. Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>


Changes
Adds a
tkn stepactioncommand group withlist,describeanddelete, as asked in #2576. I followed the customrun commands so the flags and output options match the rest of tkn.listshows name, description and age, sorted by namespace and name, with-A,--label,--limit,--reverse,--no-headersand the usual-oformatsdescribeshows image, command, args, working dir, labels/annotations, params (with defaults) and results, and lets you pick one interactively (or with--fzf) when no name is givendeleteremoves one or more StepActions and supports-o json|yamlIt reads
tekton.dev/v1beta1StepActions through the dynamic client like the other commands.Fixes #2576
/kind feature
Notes
I wrote the docs and man pages to match what
make docsgenerates (same flags as the customrun pages), but I couldn't run the generator here, so if the generated check complains I'll regenerate. Tests are added underpkg/cmd/stepaction, CI will be the first run for them.I used some help from AI, please don't yell at me. Thx.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make checkmake generatedSee the contribution guide
for more details.
Release Notes