-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 nilpointer panic when decode addlitional item failed in restore #8563
base: main
Are you sure you want to change the base?
fix nilpointer panic when decode addlitional item failed in restore #8563
Conversation
Signed-off-by: 司司 <[email protected]>
3060b6d
to
b9525af
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8563 +/- ##
==========================================
+ Coverage 59.17% 59.18% +0.01%
==========================================
Files 370 370
Lines 39487 39493 +6
==========================================
+ Hits 23366 23375 +9
+ Misses 14647 14645 -2
+ Partials 1474 1473 -1 ☔ View full report in Codecov by Sentry. |
/kind changelog-not-required |
Signed-off-by: 司司 <[email protected]>
what is the scenario where this was actually hit? |
hi, sorry that i am still trying reproduce the problem as the testing k8s cluster has been deleted. |
I am not sure if it is right to continue the restore by just putting this in error. |
A hard failure is another choice, instead of the panic currently. |
Thank you for contributing to Velero!
Please add a summary of your change
When decode additional item in
restoreItem
failed,velero/pkg/restore/restore.go
Line 1390 in 78c97d9
may case nilpointer panic in the inner function (like GetName, for exmple, as the obj is nil actually)
velero/pkg/restore/restore.go
Line 1400 in 78c97d9
with messages like (I tested in velero 1.14, but the related logic is same with the latest):
so I guess the right way is to give up restoring and just throw errors.
Does your change fix a particular issue?
Fixes #(issue)
Please indicate you've done the following:
make new-changelog
) or comment/kind changelog-not-required
on this PR.site/content/docs/main
.