kubernetes-sigs / cluster-api-provider-openstack

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

"status.bastionSecurityGroup.rules: Required value" updating cluster #1999

Closed mdbooth closed 3 months ago

mdbooth commented 3 months ago

/kind bug

From @lentzi90

❯ kubectl diff -k CAPO/test-cluster
The OpenStackCluster "lennart-test" is invalid: 
* status.bastionSecurityGroup.rules: Required value
* status.workerSecurityGroup.rules: Required value
* status.controlPlaneSecurityGroup.rules: Required value

when doing the following:

* Init with CAPO v0.9
* Create a v1alpha7 cluster
* Upgrade CAPO to v0.10.0-alpha.0
* Try to update the OpenStackCluster (e.g. add an IP to the allowedCidrs)
mdbooth commented 3 months ago

It looks like you're editing the cluster as v1alpha7, which is fine and is intended to work, but is important context.

I think this is complaining that the rules are required in v1alpha7, not v1beta1. We removed rules in v1beta1. I think what's happening here is that:

This would explain why:

mdbooth commented 3 months ago

I think the fix here is to make the field option in versions prior to v1beta1.