-
Notifications
You must be signed in to change notification settings - Fork 40.6k
Unhandled panic crash on rollout_history printer.PrintObj #130503
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
Unhandled panic crash on rollout_history printer.PrintObj #130503
Conversation
Signed-off-by: Taha Farahani <[email protected]>
Welcome @tahacodes! |
Hi @tahacodes. Thanks for your PR. I'm waiting for a kubernetes 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-sigs/prow repository. |
/assign soltysh |
Too soon :) /unassign soltysh |
/ok-to-test |
Signed-off-by: Taha Farahani <[email protected]>
Signed-off-by: Taha Farahani <[email protected]>
I've pushed the new unit test and the other required change. @brianpursley Instead of modifying the existing In this new test, I directly call |
/triage accepted |
/label tide/merge-method-squash |
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
/approve
LGTM label has been added. Git tree hash: 1fc06dddba1e4a6e3a7b2a9947a3cd6229c2bf05
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: soltysh, tahacodes 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 |
This PR will land for 1.34, and we'll want to backport this to 1.33, see https://github.com/kubernetes/community/blob/master/contributors/devel/sig-release/cherry-picks.md for how to handle that bit |
Thank you for the review. @soltysh |
Apologies for being vague, below I explain what I mean what all that, I hope 😅
We're currently in code freeze for 1.33, which is scheduled to be released on April 23rd, 2025. This means only critical issues will land k8s 1.33. This particular PR was qualified as not being that, so it'll have to wait for the next release. It will start right after this release.
Building on what I wrote above, we don't have Hope that clear things out :) |
…story printer.PrintObj (#131496) * Change: Handling nil runtime.Object Signed-off-by: Taha Farahani <[email protected]> * Change: Return only if there is error in rollout_history Signed-off-by: Taha Farahani <[email protected]> * Change: Return the unknown revision error directly in rollout_history.go Signed-off-by: Taha Farahani <[email protected]> * Change: Remove unintended newline Signed-off-by: Taha Farahani <[email protected]> * Change: Using go idiomatic way for checking if historyInfo[o.Revision] exists Signed-off-by: Taha Farahani <[email protected]> * Change: Remove 'error:' from returned error message in rollout_history.go Signed-off-by: Taha Farahani <[email protected]> * Change: Check for printer.PrintObj returned err Signed-off-by: Taha Farahani <[email protected]> * Change: Add TestRolloutHistoryErrors test Signed-off-by: Taha Farahani <[email protected]> * Change: Simple typo fix on Complete() function description Signed-off-by: Taha Farahani <[email protected]> * Change: Checking for error on o.Complete in TestRolloutHistoryErrors Signed-off-by: Taha Farahani <[email protected]> --------- Signed-off-by: Taha Farahani <[email protected]>
…#130503) * Change: Handling nil runtime.Object Signed-off-by: Taha Farahani <[email protected]> * Change: Return only if there is error in rollout_history Signed-off-by: Taha Farahani <[email protected]> * Change: Return the unknown revision error directly in rollout_history.go Signed-off-by: Taha Farahani <[email protected]> * Change: Remove unintended newline Signed-off-by: Taha Farahani <[email protected]> * Change: Using go idiomatic way for checking if historyInfo[o.Revision] exists Signed-off-by: Taha Farahani <[email protected]> * Change: Remove 'error:' from returned error message in rollout_history.go Signed-off-by: Taha Farahani <[email protected]> * Change: Check for printer.PrintObj returned err Signed-off-by: Taha Farahani <[email protected]> * Change: Add TestRolloutHistoryErrors test Signed-off-by: Taha Farahani <[email protected]> * Change: Simple typo fix on Complete() function description Signed-off-by: Taha Farahani <[email protected]> * Change: Checking for error on o.Complete in TestRolloutHistoryErrors Signed-off-by: Taha Farahani <[email protected]> --------- Signed-off-by: Taha Farahani <[email protected]>
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR prevents a panic crash when user tries to output yaml, json, etc... on a revision history.
It also reflects the
printer.PrintObj
's error back to cobra so i would print the error message to the user instead of a panic stack traceWhich issue(s) this PR fixes:
Fixes kubernetes/kubectl#1724
Special notes for your reviewer:
I've ran make verify, make test and make test-integration and i didn't find any issues related to this PR but if i messed things up or anything i'd love to follow-up more.
Does this PR introduce a user-facing change?