Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Fix crash on listing helm releases if v1 release exists #2404

Merged
merged 1 commit into from
Aug 23, 2019

Conversation

mfrister
Copy link
Contributor

Initialize two variable that weren't initalized before and resulted in a crash when a v1 helm release resource existed in the cluster.

Crash log (before the fix):

goroutine 72 [running]:
github.com/weaveworks/flux/cluster/kubernetes.(*helmReleaseKind).getWorkloads(0x286b410, 0x1aeee80, 0xc00009c058, 0xc000236700, 0xc000571200, 0xd, 0x0, 0x0, 0x0, 0x0, ...)
	/home/circleci/go/src/github.com/weaveworks/flux/cluster/kubernetes/resourcekinds.go:518 +0x165
github.com/weaveworks/flux/cluster/kubernetes.(*Cluster).ImagesToFetch(0xc000236700, 0x0)
	/home/circleci/go/src/github.com/weaveworks/flux/cluster/kubernetes/images.go:137 +0x76f
github.com/weaveworks/flux/registry.ImageCredsWithAWSAuth.func5(0xdf8475800)
	/home/circleci/go/src/github.com/weaveworks/flux/registry/aws.go:211 +0x8d
github.com/weaveworks/flux/registry/cache.(*Warmer).Loop(0xc000079e40, 0x1ab9120, 0xc00021c330, 0xc0000865a0, 0xc000044de0, 0xc0005892c0)
	/home/circleci/go/src/github.com/weaveworks/flux/registry/cache/warming.go:83 +0x90
created by main.main
	/home/circleci/go/src/github.com/weaveworks/flux/cmd/fluxd/main.go:724 +0x635f

This looks like the code will need more tests at some point, but given that the current implementation is completely broken if a v1 helm release exists, this simple fix is probably better than nothing for now.

@mfrister mfrister changed the title Fix listing helm releases if v1 release exists Fix crash on listing helm releases if v1 release exists Aug 22, 2019
@hiddeco
Copy link
Member

hiddeco commented Aug 23, 2019

Thank you for your first contribution @mfrister 🌷

@hiddeco hiddeco merged commit 64bef7a into fluxcd:master Aug 23, 2019
@mfrister mfrister deleted the fix-helm-release-workload-listing branch August 23, 2019 12:29
@kingdonb
Copy link
Member

This fixed my CrashLoopBackOff, I am using HelmReleases and had this issue with 1.14.1 too. Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants