Skip to content

Commit 1c6fedb

Browse files
authored
fix(baremetal): fix changes in plan for offer field (#2076)
* fix(baremetal): fix changes in plan for offer field * fix
1 parent 534995a commit 1c6fedb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scaleway/resource_baremetal_server.go

+9
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ func resourceScalewayBaremetalServer() *schema.Resource {
4848
Required: true,
4949
ForceNew: true,
5050
Description: "ID or name of the server offer",
51+
DiffSuppressFunc: func(_, oldValue, newValue string, d *schema.ResourceData) bool {
52+
// remove the locality from the IDs when checking diff
53+
if expandID(newValue) == expandID(oldValue) {
54+
return true
55+
}
56+
// if the offer was provided by name
57+
offerName, ok := d.GetOk("offer_name")
58+
return ok && newValue == offerName
59+
},
5160
},
5261
"offer_id": {
5362
Type: schema.TypeString,

0 commit comments

Comments
 (0)