fix: reject reserved result names in Task and StepAction validation - #10824
ogulcanaydogan wants to merge 1 commit into
Conversation
|
/kind bug |
|
[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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10824 +/- ##
=======================================
Coverage 90.73% 90.73%
=======================================
Files 297 297
Lines 22569 22573 +4
=======================================
+ Hits 20478 20482 +4
Misses 2089 2089
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
entrypointer.go writes internal bookkeeping entries (ExitCode, StartedAt, Reason) into the same result array as user-declared Task and Step results, distinguished only by ResultType. A Task or StepAction author declaring a result with one of these names collides with the internal entry, and depending on ordering the internal value may be overwritten, causing incorrect status reporting for the step. Adds a reserved-name check to TaskResult.Validate() and StepResult.Validate() so these names are rejected at webhook validation time instead of silently colliding at runtime. Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@gmail.com>
de4c8b6 to
2cd45d5
Compare
Changes
Fixes #10631.
entrypointer.gowrites internal bookkeeping entries (Key: "ExitCode",Key: "StartedAt",Key: "Reason", withResultType: InternalTektonResultType) into the same[]result.RunResulttermination message array as user-declared Task and Step results, distinguished only byResultType.If a Task or StepAction author declares a result named
ExitCode,StartedAt, orReason, the user result collides with the internal entry. Depending on ordering, the internal value may be overwritten, causing incorrect status reporting for the Step.This adds a reserved-name check to
TaskResult.Validate()andStepResult.Validate()(pkg/apis/pipeline/v1/result_validation.go), so these names are rejected at webhook validation time rather than silently colliding at runtime.This is self-inflicted-confusion prevention only (the Task author controls their own result names) — no cross-tenant or security impact, per the issue's linked security advisory triage (closed as not a vulnerability).
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes