Skip to content

Introduce v1beta2 conditions for HCloudRemediation #1957

@abdullah599

Description

@abdullah599

Summary

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

  • Base branch: v1.1.x

The Problem

HCloudRemediation is the object that drives machine health check remediation for HCloud machines. When a MachineHealthCheck marks a machine as unhealthy, the remediation controller attempts to reboot the server and, if retries are exhausted, signals CAPI to delete the machine.

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

Condition Purpose
HCloudTokenAvailable Hetzner API credentials are valid and reachable
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 HCloudRemediation to expose v1beta2 conditions in parallel so that tooling and other controllers can consume the new condition format.

The Solution

Follow the same structure used for HCloudMachine (PR #1935):

  • Add status.v1beta2.conditions to HCloudRemediation.
  • Keep writing the existing v1beta1 conditions exactly as today.
  • Add direct v1beta2conditions.Set(...) calls in the same controller code paths that already set the v1beta1 conditions.
  • Extend HCloudRemediationScope.Close() to compute:
    • the legacy v1beta1 summary
    • the v1beta2 Ready summary
    • the owned v1beta2 condition set for patching

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 HCloudRemediation are:

Constant Type Polarity Notes
HCloudRemediationReadyV1Beta2Condition clusterv1.ReadyV1Beta2Condition Positive Summary condition
HCloudTokenAvailableV1Beta2Condition HCloudTokenAvailable Positive Shared common condition: true when HCloud credentials are valid and reachable
HCloudRateLimitExceededV1Beta2Condition HCloudRateLimitExceeded Negative Shared common condition: set while the controller is rate limited by the HCloud API

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