Empty config maps for routes / receivers result in nil pointer panic
Closed this issue · 3 comments
When presenting empty config maps for routes / receivers to the alertmanager-config-controller, it crashes with a nil pointer panic which is not recovered. This should not happen.
Situation:
apiVersion: v1 data: my-alerting-alertmanager-routes.yaml: "" kind: ConfigMap metadata: annotations: alertmanager.net/route: "true" [...]
apiVersion: v1 data: my-alerting-alertmanager-receivers.yaml: "" kind: ConfigMap metadata: annotations: alertmanager.net/receiver: "true" [...]
Resulting panic:
E0218 09:41:09.651764 1 runtime.go:69] Observed a panic: "assignment to entry in nil map" (assignment to entry in nil map) /home/myuser/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190313205120-d7deff9243b1/pkg/util/runtime/runtime.go:76 /home/myuser/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190313205120-d7deff9243b1/pkg/util/runtime/runtime.go:65 /home/myuser/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190313205120-d7deff9243b1/pkg/util/runtime/runtime.go:51 /usr/local/go/src/runtime/panic.go:967 /usr/local/go/src/runtime/map_faststr.go:204 /home/myuser/Arbeit/git/src/github.com/Kirchen99/alertmanager-config-controller/controller/controller.go:355 /home/myuser/Arbeit/git/src/github.com/Kirchen99/alertmanager-config-controller/controller/controller.go:323 /home/myuser/Arbeit/git/src/github.com/Kirchen99/alertmanager-config-controller/controller/controller.go:68 /home/myuser/go/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/tools/cache/controller.go:195 /home/myuser/go/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/tools/cache/shared_informer.go:554 /home/myuser/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190313205120-d7deff9243b1/pkg/util/wait/wait.go:265 /home/myuser/go/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/tools/cache/shared_informer.go:548 /home/myuser/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190313205120-d7deff9243b1/pkg/util/wait/wait.go:152 /home/myuser/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190313205120-d7deff9243b1/pkg/util/wait/wait.go:153 /home/myuser/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190313205120-d7deff9243b1/pkg/util/wait/wait.go:88 /home/myuser/go/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/tools/cache/shared_informer.go:546 /home/myuser/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190313205120-d7deff9243b1/pkg/util/wait/wait.go:71 /usr/local/go/src/runtime/asm_amd64.s:1373 panic: assignment to entry in nil map [recovered] panic: assignment to entry in nil map
Thanks a lot for the fix. Are there any plans when this will be merged?
Thanks a lot for the fix. Are there any plans when this will be merged?
Thank you for the reporting. The fix has been merged to the master branch but we still need time to prepare for the new release. You can fetch from the master branch using git pull
and then make build
to build the binary.
We now use https://github.com/prometheus-operator/prometheus-operator to manage Prometheus, Alertmanager, etc. Therefore, we decided to archive this project here, because we think that it should rather be an archived project than one that is updated very rarely to not at all.