kube-object-storage / lib-bucket-provisioner

Library for the dynamic provisioning of object store buckets to be used by object store providers.
Apache License 2.0
20 stars 22 forks source link

Panic in overwriteAdditionalConfig #219

Closed romayalon closed 2 years ago

romayalon commented 2 years ago

Hey, I used the latest changes of the update events of OBC, I noticed that if there is no additionalConfig in Spec before the update, and after the change there is, I get a panic error from overwriteAdditionalConfig function in line 714 in controller.go and the pod is being restarted. The error message is: assignment to entry in nil map, which sounds like an initialization issue.

Thanks for your help

BlaineEXE commented 2 years ago
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)                                                                                                                                    [33/1925]
        /go/pkg/mod/k8s.io/apimachinery@v0.22.2/pkg/util/runtime/runtime.go:48 +0x86
panic(0x1da4e60, 0x234d050)
        /usr/local/go/src/runtime/panic.go:965 +0x1b9
github.com/kube-object-storage/lib-bucket-provisioner/pkg/provisioner.overwriteAdditionalConfig(0xc00082a330, 0x0)
        /go/pkg/mod/github.com/kube-object-storage/lib-bucket-provisioner@v0.0.0-20220105185820-c1da9586e05b/pkg/provisioner/controller.go:714 +0xf8
github.com/kube-object-storage/lib-bucket-provisioner/pkg/provisioner.updateSupported(0xc000ba5500, 0xc000a3e480, 0x5)
        /go/pkg/mod/github.com/kube-object-storage/lib-bucket-provisioner@v0.0.0-20220105185820-c1da9586e05b/pkg/provisioner/controller.go:666 +0x133
github.com/kube-object-storage/lib-bucket-provisioner/pkg/provisioner.NewController.func1(0x1fda8e0, 0xc000ba5500, 0x1fda8e0, 0xc000a3e480)
        /go/pkg/mod/github.com/kube-object-storage/lib-bucket-provisioner@v0.0.0-20220105185820-c1da9586e05b/pkg/provisioner/controller.go:104 +0x8c
k8s.io/client-go/tools/cache.ResourceEventHandlerFuncs.OnUpdate(...)
        /go/pkg/mod/k8s.io/client-go@v0.22.2/tools/cache/controller.go:238
k8s.io/client-go/tools/cache.(*processorListener).run.func1()
        /go/pkg/mod/k8s.io/client-go@v0.22.2/tools/cache/shared_informer.go:775 +0x1c5
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0xc00140f760)
        /go/pkg/mod/k8s.io/apimachinery@v0.22.2/pkg/util/wait/wait.go:155 +0x5f
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc000a42f60, 0x236f400, 0xc00123ed20, 0x1d5bf01, 0xc0009c0300)
        /go/pkg/mod/k8s.io/apimachinery@v0.22.2/pkg/util/wait/wait.go:156 +0x9b
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc00140f760, 0x3b9aca00, 0x0, 0x1, 0xc0009c0300)
        /go/pkg/mod/k8s.io/apimachinery@v0.22.2/pkg/util/wait/wait.go:133 +0x98
k8s.io/apimachinery/pkg/util/wait.Until(...)
        /go/pkg/mod/k8s.io/apimachinery@v0.22.2/pkg/util/wait/wait.go:90
k8s.io/client-go/tools/cache.(*processorListener).run(0xc000d37f80)
        /go/pkg/mod/k8s.io/client-go@v0.22.2/tools/cache/shared_informer.go:771 +0x95
k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1(0xc000359720, 0xc000e79340)
        /go/pkg/mod/k8s.io/apimachinery@v0.22.2/pkg/util/wait/wait.go:73 +0x51
created by k8s.io/apimachinery/pkg/util/wait.(*Group).Start
        /go/pkg/mod/k8s.io/apimachinery@v0.22.2/pkg/util/wait/wait.go:71 +0x65
panic: assignment to entry in nil map [recovered]
        panic: assignment to entry in nil map
degorenko commented 2 years ago

looks like https://github.com/kube-object-storage/lib-bucket-provisioner/blob/master/pkg/provisioner/controller.go#L713 missed nil check

degorenko commented 2 years ago

@BlaineEXE looks like we can close issue now, right?

BlaineEXE commented 2 years ago

Resolved by #222