kubernetes-sigs / cluster-api-provider-openstack

Cluster API implementation for OpenStack
https://cluster-api-openstack.sigs.k8s.io/
Apache License 2.0
279 stars 252 forks source link

v1alpha7 Machine conversion is lossy when controller sets ProviderID or InstanceID #1986

Closed mdbooth closed 3 months ago

mdbooth commented 3 months ago

/kind bug

v1alpha7 OpenStackMachine conversion should ignore changes to ProviderID and InstanceID and run the restorers even if they have changed. This is because these spec fields are modified by the openstack machine controller, so if we didn't exclude them, v1alpha7 users would always see changes to user-managed fields in the machine spec after conversion.

There's a test for this, TestMachineConversionControllerSpecFields, but it's broken in v1alpha7 and doesn't actually check that a lossy field was correctly restored.