Skip to content

Introduce v1beta2 conditions for HCloudMachine #1934

@abdullah599

Description

@abdullah599

Summary

Add v1beta2 conditions to HCloudMachine on v1.1.x while keeping the existing v1beta1 conditions unchanged.

  • Base branch: v1.1.x

What would you like to add

HCloudMachine is a primary infrastructure object that manages a real Hetzner Cloud server.

Today the machine lifecycle is surfaced through v1beta1 conditions such as:

Condition Purpose
HCloudTokenAvailable Hetzner API credentials are valid and reachable
BootstrapReady Bootstrap data has been provided by CAPI
ServerCreateSucceeded Server was successfully created in HCloud
ServerAvailable Server is running and usable
HetznerAPIReachable The controller is not blocked by HCloud rate limiting

These conditions are still needed and must keep their current behavior. At the same time, the CAPI v1beta2 transition requires HCloudMachine to expose v1beta2 conditions in parallel.

Deletion also needs to be visible more clearly. Today it is mostly inferred from metadata.deletionTimestamp, finalizers, and legacy ServerAvailable=False transitions. We want a dedicated v1beta2 Deleting condition for HCloudMachine.

The Solution

Follow the same structure CAPV used:

  • Add status.v1beta2.conditions to HCloudMachine.
  • Keep writing the existing v1beta1 conditions exactly as today.
  • Add direct v1beta2conditions.Set(...) calls in the same controller and service code paths that already set the v1beta1 conditions.
  • Add a controller local patch step for HCloudMachine that computes:
    • the legacy v1beta1 summary
    • the v1beta2 Ready summary
    • the owned v1beta2 condition set for patching
  • Add a dedicated v1beta2 Deleting condition.

This keeps the behavior explicit at each reconcile decision point and avoids a second translation layer that can drift from the real lifecycle logic.

Final Conditions

The final v1beta2 conditions added for HCloudMachine are:

Constant Type Polarity Notes
HCloudMachineReadyV1Beta2Condition clusterv1.ReadyV1Beta2Condition Positive Summary condition
HCloudMachineHCloudTokenAvailableV1Beta2Condition HCloudTokenAvailable Positive True when HCloud credentials are valid and reachable
HCloudMachineBootstrapReadyV1Beta2Condition BootstrapReady Positive True when bootstrap data is available
HCloudMachineServerCreatedV1Beta2Condition ServerCreated Positive True when the HCloud server has been provisioned
HCloudMachineServerAvailableV1Beta2Condition ServerAvailable Positive True when the server is running and usable
HCloudMachineDeletingV1Beta2Condition clusterv1.DeletingV1Beta2Condition Negative Dedicated deletion signal for HCloudMachine
HCloudMachineHCloudRateLimitExceededV1Beta2Condition HCloudRateLimitExceeded Negative True when HCloud API rate limit has been exceeded. Set to False on every successful reconcile (happy path setter).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions