Skip to content

Commit a68a9ea

Browse files
authored
instance: fix network interface plan modifier (#634)
The instance `mac_address` is also a computed attribute, so it needs to be set to `unknown` if the network interface is recreated. I tried to create a reflect-based approach to handle this automatically, but the code was a bit too much for what it is doing. I don't expect we would change the schema too often, so I found a more explicit approach better. We should reconsider this decision If we find ourselves running into problems keeping this function updated though.
1 parent c7f5384 commit a68a9ea

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

internal/provider/resource_instance.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2873,6 +2873,7 @@ func (v instanceNetworkInterfacesPlanModifier) PlanModifySet(
28732873
if nic.Hash() != stateNIC.Hash() {
28742874
plan[i].ID = types.StringUnknown()
28752875
plan[i].IPAddr = types.StringUnknown()
2876+
plan[i].MAC = types.StringUnknown()
28762877
plan[i].Primary = types.BoolUnknown()
28772878
plan[i].TimeCreated = types.StringUnknown()
28782879
plan[i].TimeModified = types.StringUnknown()

0 commit comments

Comments
 (0)