Add logging when instance no longer exists
This commit is contained in:
parent
5f90a4bc7e
commit
ede5ebb368
|
@ -549,9 +549,11 @@ func resourceComputeInstanceCreate(d *schema.ResourceData, meta interface{}) err
|
||||||
func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error {
|
func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
config := meta.(*Config)
|
config := meta.(*Config)
|
||||||
|
|
||||||
|
id := d.Id()
|
||||||
instance, err := getInstance(config, d)
|
instance, err := getInstance(config, d)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if strings.Contains(err.Error(), "no longer exists") {
|
if strings.Contains(err.Error(), "no longer exists") {
|
||||||
|
log.Printf("[WARN] Google Compute Instance (%s) not found", id)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue