Skip to content

Commit

Permalink
Fix refresh 404 error for kibana object
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonbondon committed Dec 22, 2017
1 parent e8fc7e9 commit 92a3270
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion resource_elasticsearch_kibana_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ func resourceElasticsearchKibanaObjectRead(d *schema.ResourceData, meta interfac
// termQuery := elastic.Query(elastic.NewTermQuery("title", id))
result, err := client.Get().Index(d.Get("index").(string)).Type(objectType).Id(id).Do(context.TODO())
if err != nil {
log.Printf("[INFO] Not found: %s %s %s", id, objectType, d.Get("index").(string))
if elastic.IsNotFound(err) {
log.Printf("[WARN] Kibana Object (%s) not found, removing from state", id)
d.SetId("")
return nil
}

return err
}
if result.Found {
Expand Down

0 comments on commit 92a3270

Please sign in to comment.