-
Couldn't load subscription status.
- Fork 1.8k
fix(validation): apply SetDefaults to both specs before comparison #9004
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
Conversation
Apply SetDefaults to both old and new specs in ValidateUpdate methods to handle cases where default field values have changed between API versions. This prevents upgrade scenarios from being incorrectly flagged as user modifications when only default values have changed. Fixes issue where v1beta1 PipelineRun/TaskRun resources in production fail validation after Tekton upgrade due to timeout field structure differences between old and new default values. - Apply SetDefaults to old spec copy before comparison - Apply SetDefaults to new spec copy before comparison - Add comprehensive test cases for upgrade scenarios - Ensure actual user modifications are still caught correctly Affects both v1 and v1beta1 API versions for PipelineRun and TaskRun validation methods.
|
/kind bug |
|
The following is the coverage report on the affected files.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: danielfbm 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 |
|
The following is the coverage report on the affected files.
|
|
Does it seem like failure is related to the environment? It looks like the 2025-09-03T07:27:37.4834234Z resolvers_test.go:598: Error waiting for gitea-0 pod to be running: timed out waiting for the condition
2025-09-03T07:27:37.4834572Z panic.go:636: ############################################
2025-09-03T07:27:37.4834793Z panic.go:636: ### Dumping objects from arendelle-vb6vl ###
2025-09-03T07:27:37.4834982Z panic.go:636: ############################################
2025-09-03T07:27:37.4835092Z panic.go:636:
2025-09-03T07:27:37.4835424Z panic.go:636: #####################################################
2025-09-03T07:27:37.4835677Z panic.go:636: ### Dumping logs from Pods in the arendelle-vb6vl ###
2025-09-03T07:27:37.4835877Z panic.go:636: #####################################################
2025-09-03T07:27:37.4836090Z panic.go:636: Not deleting namespace arendelle-vb6vl
2025-09-03T07:27:37.4836226Z --- FAIL: TestGitResolver_API_Identifier (606.14s)
2025-09-03T07:27:37.4836326Z === NAME TestGitResolver_API
2025-09-03T07:27:37.4836733Z resolvers_test.go:536: Error waiting for gitea-0 pod to be running: timed out waiting for the condition
2025-09-03T07:27:37.4836932Z panic.go:636: ############################################
2025-09-03T07:27:37.4837158Z panic.go:636: ### Dumping objects from arendelle-8w5kj ###
2025-09-03T07:27:37.4837354Z panic.go:636: ############################################
2025-09-03T07:27:37.4837571Z panic.go:636:
2025-09-03T07:27:37.4837830Z panic.go:636: #####################################################
2025-09-03T07:27:37.4838166Z panic.go:636: ### Dumping logs from Pods in the arendelle-8w5kj ###
2025-09-03T07:27:37.4838454Z panic.go:636: #####################################################
2025-09-03T07:27:37.4838692Z panic.go:636: Not deleting namespace arendelle-8w5kj
2025-09-03T07:27:37.4838887Z --- FAIL: TestGitResolver_API (606.32s)
2025-09-03T07:27:37.4838996Z === NAME TestGitResolver_HTTPAuth
2025-09-03T07:27:37.4839515Z resolvers_test.go:483: Error waiting for gitea-0 pod to be running: timed out waiting for the condition
2025-09-03T07:27:37.4839813Z panic.go:636: ############################################
2025-09-03T07:27:37.4840032Z panic.go:636: ### Dumping objects from arendelle-f84mz ###
2025-09-03T07:27:37.4840214Z panic.go:636: ############################################
2025-09-03T07:27:37.4840325Z panic.go:636:
2025-09-03T07:27:37.4840645Z panic.go:636: #####################################################
2025-09-03T07:27:37.4840889Z panic.go:636: ### Dumping logs from Pods in the arendelle-f84mz ###
2025-09-03T07:27:37.4841089Z panic.go:636: #####################################################
2025-09-03T07:27:37.4841286Z panic.go:636: Not deleting namespace arendelle-f84mz
2025-09-03T07:27:37.4841416Z --- FAIL: TestGitResolver_HTTPAuth (606.29s)
2025-09-03T07:27:37.4841493Z FAIL2025-09-03T07:36:32.6526101Z ***************************************
2025-09-03T07:36:32.6526524Z *** E2E TEST FAILED ***
2025-09-03T07:36:32.6527174Z *** Start of information dump ***
2025-09-03T07:36:32.6527654Z ***************************************
2025-09-03T07:36:32.6528216Z >>> All resources:
2025-09-03T07:36:32.8444245Z NAMESPACE NAME READY STATUS RESTARTS AGE
2025-09-03T07:36:32.8444901Z arendelle-8w5kj pod/gitea-0 0/1 CrashLoopBackOff 8 (2m27s ago) 19m
2025-09-03T07:36:32.8445722Z arendelle-8w5kj pod/gitea-memcached-599fcbdf58-z4qds 0/1 ImagePullBackOff 0 19m
2025-09-03T07:36:32.8446438Z arendelle-8w5kj pod/gitea-postgresql-0 1/1 Running 0 19m
2025-09-03T07:36:32.8447039Z arendelle-f84mz pod/gitea-0 0/1 CrashLoopBackOff 8 (118s ago) 19m
2025-09-03T07:36:32.8447824Z arendelle-f84mz pod/gitea-memcached-599fcbdf58-mkf7z 0/1 ImagePullBackOff 0 19m
2025-09-03T07:36:32.8448454Z arendelle-f84mz pod/gitea-postgresql-0 1/1 Running 0 19m
2025-09-03T07:36:32.8449243Z arendelle-q8ps4 pod/authenticating-git-commands-pod 1/4 NotReady 0 11s
2025-09-03T07:36:32.8449933Z arendelle-rxjjh pod/authenticating-git-commands-pod 1/4 Terminating 0 19s
2025-09-03T07:36:32.8451263Z arendelle-vb6vl pod/gitea-0 0/1 CrashLoopBackOff 8 (2m40s ago) 19m
2025-09-03T07:36:32.8452031Z arendelle-vb6vl pod/gitea-memcached-599fcbdf58-s2ktc 0/1 ImagePullBackOff 0 19m
2025-09-03T07:36:32.8452934Z arendelle-vb6vl pod/gitea-postgresql-0 1/1 Running 0 19m |
|
Duplicate of #9011 |
Apply SetDefaults to both old and new specs in ValidateUpdate methods to handle cases where default field values have changed between API versions. This prevents upgrade scenarios from being incorrectly flagged as user modifications when only default values have changed.
Fixes issue where v1beta1 PipelineRun/TaskRun resources in production fail validation after Tekton upgrade due to timeout field structure differences between old and new default values.
Affects both v1 and v1beta1 API versions for PipelineRun and TaskRun validation methods.
I encountered this problem when upgrading Pipelines in my environment from version `0.56` to `0.65`.
Previously completed
v1beta1 PipelineRunsin the cluster were unable to have their finalizers removed, with the error messageOnce the PipelineRun is complete, no updates are allowedThis prevented these resources from being properly cleaned up. I wasn't actually modifying any Spec fields.After applying this fix, the issue was resolved.
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