You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps did you take and what happened:
When an OpenStackCluster CR is automatically converted from v1alpha7 to v1beta1, the field DisableAPIServerFloatingIP is converted using Convert_bool_To_optional_Bool. This function omits fields that are set to false or nil, leading to their removal from the resulting CR.
If spec.disableAPIServerFloatingIP field was explicitly set as false in v1alpha7, it gets removed during the upgrade to v1beta1.
Since the OpenStackCluster validation webhook does not allow changes to this field after creation, it cannot be set back to false once omitted.
This affects 3rd party controllers/operators managing CAPO CRs, as they fail when attempting to ensure the missing field.
Other optional boolean fields converted in a similar manner are also likely impacted.
What did you expect to happen:
Boolean fields that explicitly have a value (even false) should not be omitted during conversion.
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
Environment:
Cluster API Provider OpenStack version (Or git rev-parse HEAD if manually built): 0.11.2
Cluster-API version: 0.8.4
OpenStack version: All maintained versions
Minikube/KIND version:
Kubernetes version (use kubectl version): 1.31
OS (e.g. from /etc/os-release): Ubuntu Jammy
The text was updated successfully, but these errors were encountered:
I wonder if a big part of this is probably for the fact these are "negative" boolean fields. For example, if we had a field called enableAPIServerFloatingIP and this was used, it would be just fine, cause false and no value would both result in it being disabled (implicit false), but since this is a "negative bool", this is problematic.
We'd need to audit any negative bools in thsi case.
/kind bug
What steps did you take and what happened:
When an OpenStackCluster CR is automatically converted from v1alpha7 to v1beta1, the field DisableAPIServerFloatingIP is converted using Convert_bool_To_optional_Bool. This function omits fields that are set to false or nil, leading to their removal from the resulting CR.
cluster-api-provider-openstack/api/v1alpha7/zz_generated.conversion.go
Line 983 in 685b5ee
cluster-api-provider-openstack/pkg/utils/optional/conversion.go
Lines 105 to 112 in 685b5ee
If
spec.disableAPIServerFloatingIP
field was explicitly set asfalse
in v1alpha7, it gets removed during the upgrade to v1beta1.Since the OpenStackCluster validation webhook does not allow changes to this field after creation, it cannot be set back to false once omitted.
This affects 3rd party controllers/operators managing CAPO CRs, as they fail when attempting to ensure the missing field.
Other optional boolean fields converted in a similar manner are also likely impacted.
What did you expect to happen:
Boolean fields that explicitly have a value (even
false
) should not be omitted during conversion.Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
Environment:
git rev-parse HEAD
if manually built): 0.11.2kubectl version
): 1.31/etc/os-release
): Ubuntu JammyThe text was updated successfully, but these errors were encountered: