Skip to content
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(pkg/repository/maintenance): handle when there's no container status #8271

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

mcluseau
Copy link
Contributor

@mcluseau mcluseau commented Oct 6, 2024

Fixes a crash in this case.

panic: runtime error: index out of range [0] with length 0 [recovered]
	panic: runtime error: index out of range [0] with length 0

goroutine 562 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:116 +0x1e5
panic({0x2ae2cc0?, 0xc001a084b0?})
	/usr/local/go/src/runtime/panic.go:770 +0x132
github.com/vmware-tanzu/velero/pkg/repository.GetMaintenanceResultFromJob({0x318cd00, 0xc0009be3f0}, 0xc0025ae508)
	/go/src/github.com/vmware-tanzu/velero/pkg/repository/maintenance.go:120 +0x229

@mcluseau
Copy link
Contributor Author

mcluseau commented Oct 7, 2024

Hi @mateusoliveira43 , sure, I've updated the comments and the error

@mcluseau
Copy link
Contributor Author

mcluseau commented Oct 7, 2024

if you're like me, you'd notice rust would have made the problem much more obvious in the first place 😅

@mateusoliveira43
Copy link
Contributor

@mcluseau yeah, Go errors are almost unreadable, thanks for taking time to fix this!

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.00%. Comparing base (c53ab20) to head (e770f0c).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8271      +/-   ##
==========================================
+ Coverage   58.99%   59.00%   +0.01%     
==========================================
  Files         367      367              
  Lines       38847    38857      +10     
==========================================
+ Hits        22918    22928      +10     
  Misses      14467    14467              
  Partials     1462     1462              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kaovilai
Copy link
Member

kaovilai commented Oct 7, 2024

@mcluseau please add changelog

@kaovilai
Copy link
Member

kaovilai commented Oct 7, 2024

Add changelog here
https://github.com/vmware-tanzu/velero/tree/main/changelogs/unreleased
File name: <pr-num>-<gh-username>

Copy link
Member

@kaovilai kaovilai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO. but not blocked on it.

changelogs/unreleased/8271-mcluseau Outdated Show resolved Hide resolved
@Lyndon-Li
Copy link
Contributor

@mcluseau
Please don't resolve the comments until consensus are made with the commenter, otherwise, maintainers may think the PR is ready and merge it.

@mcluseau
Copy link
Contributor Author

@mcluseau Please don't resolve the comments until consensus are made with the commenter, otherwise, maintainers may think the PR is ready and merge it.

2 weeks looked like a lazy consensus to me, but ok, I won't touch those buttons again 😅

@Lyndon-Li
Copy link
Contributor

We are creating release of 1.15, let's merge this PR after 1.15 branch is cut.

@blackpiglet blackpiglet merged commit 8058a38 into vmware-tanzu:main Oct 28, 2024
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants