bacongobbler / helm-whatup

A Helm plugin to help users determine if there's an update available for their installed charts.
Other
84 stars 13 forks source link

Fixes segfault when no releases exist. #13

Closed schegi closed 5 years ago

schegi commented 5 years ago

When no releases exist (helm list empty) whatup raises panic: runtime error: invalid memory address or nil pointer dereference due to the fact that the result of client.ListReleases is empty.

bacongobbler commented 5 years ago

Looks like a few things from #14 leaked in here. Can you remove the lines where there's a format check? That doesn't seem to be related to the fix this PR addresses. Thanks.

schegi commented 5 years ago

Didn't really get it, sry. Isn't it the other way around and some lines from #13 leaked to #14. Pleased confirm and i'll fix that tomorrow.

bacongobbler commented 5 years ago

The if outputFmt == "plain" doesn't appear to be relevant to fixing the segfault issue. Those should probably be removed.

schegi commented 5 years ago

Ah, described it in the comment. Isn't directly related to the segfault. Otherwise even with -o json, whatup would return invalid json which ist also an issued from my point of View. If you prefer i can make an extra PR out of it.

schegi commented 5 years ago

Removed the mentioned lines from this PR and added a new PR #15 which implements this fix.