Open displague opened 4 months ago
The IP reservation is being successfully created. The problem seems to be at refresh, related to the quantity being set to 256 as a computed field despite the field conflicting with the other fields (cidr, vrf_id).
The Crossplane provider's LateInitializer
of quantity
field (optional and computed in Terraform) is problematic in this case.
We'll want to change the default initializer, as discussed here https://github.com/crossplane/upjet/blob/e295e17c7be7af3fe711ed53bae201f04f1fa797/docs/configuring-a-resource.md?plain=1#L732, and as previously implemented for the device
managed resources due to similar behavior between the Metro and Facility fields which were mutually exclusive but required and (in some revisions) computed when not specified: https://github.com/crossplane-contrib/provider-jet-equinix/blob/main/config/metal/device/config.go#L24-L35
What happened?
Given the following XRD, a ReservedIPBlock will fail to reconcile with errors about quantity conflicting with vrf_id even when no quantity is set and vrf_id is supplied through patching.
XRD ("MetalNetwork" creates a VRF + VLAN + Gateway (associated with the VLAN, with IP reservations from the VRF)
Claim:
Quantity above is shown as 256 but that is not defined anywhere in the XRD or claim. I tried setting
quantity: null
in the XRD, but that didn't help either.How can we reproduce it?
What environment did it happen in?
Crossplane version: v1.16.0 Provider version: v0.6.1