seznam/slo-exporter

Empty slo-exporter configuration is declared as valid

freznicek opened this issue · 0 comments

Problem

Empty main configuration file is according to config checker valid. This is incorrect.

Reproducibility 100%

$ ./slo_exporter --version
slo_exporter version 6.4.0 (from commit 3c44f001e863265e588e319138e743bc682b70b3 at 2020-08-07T10:58:03Z by goreleaser)

$ touch /tmp/slo-exporter.yaml
✓ freznicek@localhost.localdomain /tmp

$ ./slo_exporter --config-file /tmp/slo-exporter.yaml --check-config
time="2020-08-07T16:23:38.01516+02:00" level=info msg="Configuration is valid!"
✓ freznicek@localhost.localdomain /tmp

$ ./slo_exporter --config-file /tmp/slo-exporter.yaml
time="2020-08-07T16:23:42.81021+02:00" level=warning msg="changing readiness status to not ok, reason: initializing" component=prober
...
time="2020-08-07T16:23:42.8119+02:00" level=info msg="changing readiness status to ok" component=prober
time="2020-08-07T16:23:43.81233+02:00" level=info msg="finished processing all logs"
time="2020-08-07T16:23:43.81245+02:00" level=info msg="gracefully shutting down"
time="2020-08-07T16:23:43.8125+02:00" level=warning msg="changing readiness status to not ok, reason: shutting down" component=prober
time="2020-08-07T16:23:43.81258+02:00" level=info msg="see you next time!"
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/seznam/slo-exporter/pkg/pipeline.(*Manager).StopPipeline(0xc00025e240, 0xe85e60, 0xc000316180, 0xe85e60)
        /home/circleci/project/pkg/pipeline/manager.go:69 +0xc1
main.main()
        /home/circleci/project/cmd/slo_exporter.go:224 +0x1365