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

[Release v0.9] Cannot delete a server in ERROR state which has trunk ports #2091

Open mdbooth opened 1 month ago

mdbooth commented 1 month ago

/kind bug

In v0.9, if the instance is in error state we call GarbageCollectErrorInstancesPort, which doesn't support trunk ports: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/4042fc614c8b06be42032b2c94a970670f6288b7/pkg/cloud/services/compute/instance.go#L677-L687

This isn't the case on main, which has a completely different code path for this. On main we always adopt ports, and will always clean them up, along with trunks.

We will also panic if the port doesn't exist because we don't check for an empty port list.