Commit f3938728 authored by Ben Wilson's avatar Ben Wilson Committed by GitHub

Merge pull request #1980 from ethereum-optimism/bwilson/fix/op-exporter-version-nil-deference

op-exporter version nil deference
parents 1644c7b2 673bfcc4
---
'@eth-optimism/op-exporter': patch
---
Fixes panic caused by version initialized to nil
......@@ -20,6 +20,8 @@ import (
"k8s.io/client-go/kubernetes"
)
var UnknownStatus = "UNKNOWN"
var (
listenAddress = kingpin.Flag(
"web.listen-address",
......@@ -86,7 +88,7 @@ func main() {
healthy: false,
updateTime: time.Now(),
allowedMethods: nil,
version: nil,
version: &UnknownStatus,
}
http.Handle("/metrics", promhttp.Handler())
http.Handle("/health", healthHandler(&health))
......@@ -130,8 +132,7 @@ func getSequencerVersion(health *healthCheck, client *kubernetes.Clientset) {
}
sequencerStatefulSet, err := client.AppsV1().StatefulSets(string(ns)).Get(context.TODO(), "sequencer", getOpts)
if err != nil {
unknownStatus := "UNKNOWN"
health.version = &unknownStatus
health.version = &UnknownStatus
log.Errorf("Unable to retrieve a sequencer StatefulSet: %s", err)
continue
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment