Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit ad25370

Browse files
author
[Partner] Alexander Sokolov
committed
resource gcore_floatingip read fixed
1 parent f8120b5 commit ad25370

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ terraform {
1818
required_providers {
1919
gcore = {
2020
source = "G-Core/gcorelabs"
21-
version = "0.3.17"
21+
version = "0.3.18"
2222
}
2323
}
2424
}

examples/provider/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
required_providers {
44
gcore = {
55
source = "G-Core/gcorelabs"
6-
version = "0.3.17"
6+
version = "0.3.18"
77
}
88
}
99
}

gcore/resource_gcore_floatingip.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,14 @@ func resourceFloatingIPRead(ctx context.Context, d *schema.ResourceData, m inter
182182

183183
floatingIP, err := floatingips.Get(client, d.Id()).Extract()
184184
if err != nil {
185-
return diag.FromErr(err)
185+
switch err.(type) {
186+
case gcorecloud.ErrDefault404:
187+
log.Printf("[WARN] Removing floating ip %s because resource doesn't exist anymore", d.Id())
188+
d.SetId("")
189+
return nil
190+
default:
191+
return diag.FromErr(err)
192+
}
186193
}
187194

188195
if floatingIP.FixedIPAddress != nil {

0 commit comments

Comments
 (0)