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
Support cluster name determination via label for ClusterClass compatibility (#165)
* Support cluster name determination via label for ClusterClass compatibility
Cluster API, when using the ClusterClass approach, automatically sets the
`cluster.x-k8s.io/cluster-name` label on the OpenStackCluster resource. It also
generates the OpenStackCluster `metadata.name` by appending five random characters
(e.g. `<cluster-name>-pr2wr`). As a result, relying solely on the resource name
to determine the cluster name caused deletion to fail, since the expected
cluster name could not be matched with existing resources, e.g. LBs.
This commit updates the cluster name detection logic to first check for the
presence of the `cluster.x-k8s.io/cluster-name` label. If the label is found,
its value is used as the cluster name. If the label is not present, the
OpenStackCluster's `metadata.name` is used as a fallback.
This change maintains backward compatibility and does not introduce any
breaking behavior for clusters that do not use ClusterClass.
Signed-off-by: Matej Feder <[email protected]>
* Apply suggestions from code review
Co-authored-by: Matt Anson <[email protected]>
---------
Signed-off-by: Matej Feder <[email protected]>
Co-authored-by: Matt Anson <[email protected]>
0 commit comments