syself / cluster-api-provider-hetzner

Cluster API Provider Hetzner :rocket: The best way to manage Kubernetes clusters on Hetzner, fully declarative, Kubernetes-native and with self-healing capabilities
https://caph.syself.com
Apache License 2.0
619 stars 58 forks source link

:seedling: Set providerID in phase ensure-provisioned #1351

Closed janiskemper closed 3 months ago

janiskemper commented 3 months ago

What this PR does / why we need it: Currently, we set the providerID of a baremetal server only after we confirmed that cloud init has successfully completed. However, CAPI also reacts on the result of cloud init, so there might be a temporary state when CAPI already reconciles the node object, CSRs are created, etc., but we have not yet set the providerID.

This leads for example to errors in the csr-controller, where we rely on the providerID to be set.

This PR sets the providerID already in ensure-provisioned state, so that these temporary errors should not occur anymore.

I think we will prefer this approach: https://github.com/syself/cluster-api-provider-hetzner/pull/1357

TODOs:

guettli commented 3 months ago

Just for the records, we cherry-picked this PR, and then the bm machines failed to join the cluster.

guettli commented 3 months ago

This was merged instead: https://github.com/syself/cluster-api-provider-hetzner/pull/1357