Closed treywelsh closed 1 year ago
There is more work than I expected initially:
I realized that there is some fields like gateway
with a computed behavior, not sure they are useful, and by the way it seems that some reading code around Vnet template elements were missing.
Here are the attributes I'm looking at for now in this PR: gateway
, network_address
, network_mask
, search_domain
, dns
Seems I can't use TestCheckNoResourceAttr
to test gateway
attribute removal in state, so, in place I test for an empty value:
resource.TestCheckResourceAttr("opennebula_virtual_network.test", "gateway", ""),
I already used TestCheckNoResourceAttr
but for values stored inside of a container type, or for the container type itself (TypeSet, TypeList, TypeMap...)
There is an other problem: in adding missing reading code for gateway
, network_address
, network_mask
, search_domain
, dns
, acceptance tests fails for virtual network reservation:
The reservation seems to inherits attributes from it's parent network.
To solve this I'll ignore these attributes at read step when reservation_vnet
is set.
My initial idea was to do something similar to the virtual machine resource when it inherit the attributes from a template with the template_tags
section (i.e. keep elements from the template resource to avoid reading them in virtual machine code when they are inherithed but not configured).
But finally it's a bit more than needed for this particular case.
Community Note
Description
Rework virtual network template update
References
Close #428 Close #436
New or Affected Resource(s)
Checklist
References
go fmt
)