rancher_host: error on nil or removed host (#15015)
This commit is contained in:
parent
2b9b89197d
commit
1c56db5ffa
|
@ -97,6 +97,18 @@ func resourceRancherHostRead(d *schema.ResourceData, meta interface{}) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if host == nil {
|
||||
log.Printf("[INFO] Host %s not found", d.Id())
|
||||
d.SetId("")
|
||||
return nil
|
||||
}
|
||||
|
||||
if removed(host.State) {
|
||||
log.Printf("[INFO] Host %s was removed on %v", d.Id(), host.Removed)
|
||||
d.SetId("")
|
||||
return nil
|
||||
}
|
||||
|
||||
log.Printf("[INFO] Host Name: %s", host.Name)
|
||||
|
||||
d.Set("description", host.Description)
|
||||
|
|
Loading…
Reference in New Issue