-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix: ensure default type for params in remote tasks to prevent pipeline failures #7776
fix: ensure default type for params in remote tasks to prevent pipeline failures #7776
Conversation
Hi @l-qing. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
The following is the coverage report on the affected files.
|
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.
/ok-to-test
/cc @tektoncd/core-maintainers @abayer
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The following is the coverage report on the affected files.
|
8cdd12d
to
cf4aa54
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
cf4aa54
to
8610fc1
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
8610fc1
to
703310f
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
703310f
to
a3aa1bc
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
a3aa1bc
to
fe42657
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
fe42657
to
34fcb87
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
…ne failures fix tektoncd#7775 In the existing logic, resources used for ConvertTo should have default values set. Otherwise, there could be issues with incorrect parameter types being set (e.g., an array type being treated as a string type). However, resources fetched from remote sources haven't undergone the SetDefaults operation. If we directly invoke the ConvertTo operation, it might result in erroneous outcomes. For instance, a v1beta1 ClusterTask that undergoes a direct ConvertTo to convert the resource into a v1 Task for validation might be mistakenly considered invalid. Additionally, even if a v1beta1 Task passes validation, the process of converting it to a v1 Task could still incorrectly set default parameter types, leading to errors during execution.
34fcb87
to
d8e6d8b
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
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
fix #7775
analyze
In the existing logic, resources used for ConvertTo should have default values set. Otherwise, there could be issues with incorrect parameter types being set (e.g., an array type being treated as a string type).
pipeline/pkg/apis/pipeline/v1beta1/param_conversion.go
Lines 25 to 31 in f3dd478
However, resources fetched from remote sources haven't undergone the SetDefaults operation. If we directly invoke the ConvertTo operation, it might result in erroneous outcomes.
pipeline/pkg/apis/pipeline/v1beta1/param_types.go
Lines 72 to 101 in f3dd478
For instance, a v1beta1 ClusterTask that undergoes a direct ConvertTo to convert the resource into a v1 Task for validation might be mistakenly considered invalid.
pipeline/pkg/reconciler/taskrun/resources/taskref.go
Lines 212 to 219 in f3dd478
pipeline/pkg/reconciler/taskrun/resources/taskref.go
Lines 305 to 314 in f3dd478
Additionally, even if a v1beta1 Task passes validation, the process of converting it to a v1 Task could still incorrectly set default parameter types, leading to errors during execution.
pipeline/pkg/reconciler/taskrun/resources/taskref.go
Lines 194 to 211 in f3dd478
Tips
This issue has been present since this commit 445734d92, affecting versions v0.51 - v0.57.
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
/kind bug