curielogger: Fix NIL when rst is nil
@@ -401,7 +401,8 @@ func (l *ElasticsearchLogger) ConfigureKibana() {
rst, err := client.Do(req)
- if err == nil && rst.StatusCode == 200 {
+ if rst != nil {
+ if rst.StatusCode == 200 {
log.Printf("[INFO]: kibana index pattern created %s", kbUrl)
break
}
@@ -410,6 +411,7 @@ func (l *ElasticsearchLogger) ConfigureKibana() {
log.Printf("[INFO]: kibana index pattern already exists %s", kbUrl)
break
}
+ }
log.Printf("[ERROR]: kibana index pattern creation failed (retrying in 5s) %s %v %v", kbUrl, err, rst)
time.Sleep(5 * time.Second)
