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

Commit

Permalink
shipper-state-metrics: initialize rolloutblocks lister
Browse files Browse the repository at this point in the history
This fixes a panic when running the collector:

```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x116ce51]

goroutine 342 [running]:
main.ShipperStateMetrics.collectRolloutBlocks(0x1610760, 0xc00041e010, 0x1610860, 0xc00041e030, 0x1610820, 0xc00041e050, 0x16107a0, 0xc00041e070, 0x16108e0, 0xc00041e090, ...)
	/shipper/cmd/shipper-state-metrics/collector.go:351 +0x101
main.ShipperStateMetrics.Collect(0x1610760, 0xc00041e010, 0x1610860, 0xc00041e030, 0x1610820, 0xc00041e050, 0x16107a0, 0xc00041e070, 0x16108e0, 0xc00041e090, ...)
	/shipper/cmd/shipper-state-metrics/collector.go:101 +0x194
github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
	/shipper/vendor/github.com/prometheus/client_golang/prometheus/registry.go:434 +0x19d
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather
	/shipper/vendor/github.com/prometheus/client_golang/prometheus/registry.go:445 +0x571
```
  • Loading branch information
juliogreff committed Sep 16, 2019
1 parent d10f43b commit d107ef0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/shipper-state-metrics/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func main() {
ctsLister: shipperInformerFactory.Shipper().V1alpha1().CapacityTargets().Lister(),
ttsLister: shipperInformerFactory.Shipper().V1alpha1().TrafficTargets().Lister(),
clustersLister: shipperInformerFactory.Shipper().V1alpha1().Clusters().Lister(),
rbLister: shipperInformerFactory.Shipper().V1alpha1().RolloutBlocks().Lister(),

nssLister: kubeInformerFactory.Core().V1().Namespaces().Lister(),
secretsLister: kubeInformerFactory.Core().V1().Secrets().Lister(),
Expand Down

0 comments on commit d107ef0

Please sign in to comment.