-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: panic in v1beta1 matrix validation for invalid result refs #9135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: panic in v1beta1 matrix validation for invalid result refs #9135
Conversation
This fix applies the same safety check that was added to v1 pipelines in PR tektoncd#8089. The validateMatrixedPipelineTaskConsumed function was panicking when encountering invalid variable substitutions like $(tasks)-$(tasks.echo-result.results.output) because it tried to access subExpressions[1] without first checking if the expression was a valid result reference. The fix adds a check to skip expressions that don't look like result references before attempting to parse them, preventing the panic and allowing the webhook to return a proper validation error instead. Fixes: SRVKP-9204 Related: tektoncd#8089
355e530 to
9bed296
Compare
|
/kind fix |
|
@mathur07: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/ok-to-test |
|
/retest |
|
|
|
The test failure appears to be a Docker Hub rate-limiting issue. |
|
CI will likely be resolved with #9139 |
aThorp96
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aThorp96 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
This fix applies the same safety check that was added to v1 pipelines in PR #8089. The validateMatrixedPipelineTaskConsumed function was panicking when encountering invalid variable substitutions like "$(tasks)-$(tasks.echo-result.results.output)" because it tried to access subExpressions[1] without first checking if the expression was a valid result reference.
The fix adds a check to skip expressions that don't look like result references before attempting to parse them, preventing the panic and allowing the webhook to return a proper validation error instead.
Fixes: SRVKP-9204
Related: #8089
Changes
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