What happens today
Every object we manage (HetznerCluster, HCloudMachine, HetznerBareMetalHost and so on) reports a top level Ready condition, which is how a user sees whether the object is fully up. We do not set Ready by hand. In CAPI v1beta2 it is a summary of smaller sub conditions, where each sub condition reports one step, for example ServerCreated, ServerProvisioned and ServerAvailable on an HCloudMachine. Ready turns True once the steps it covers are True.
CAPI computes that with NewSummaryCondition, which each controller calls in its scope Close. We tell it what to summarize through a per resource SummaryOpts function (this one is HCloudMachine's). It has two parts:
ForConditionTypes is the list of sub conditions that make up Ready
IgnoreTypesIfMissing is the subset by which we tell CAPI to leave a missing one out instead of counting it as Unknown when computing Ready
The problem arises when every condition in ForConditionTypes is also in IgnoreTypesIfMissing and the object has none of them set yet, the summary has nothing to work with and returns summary can't be performed when the list of conditions to be summarized is empty. We hit this on a fresh HCloudMachine, whose SummaryOpts lists all five conditions in both lists. The same shape exists on HCloudRemediation and HetznerBareMetalMachine, so they can hit it too.
What should happen
Audit each resource's SummaryOpts and keep a condition in IgnoreTypesIfMissing only when a missing value does not mean the object is not ready. Every other condition, the real lifecycle steps and the token, stays required.
Two kinds of condition pass that test for us. The negative polarity ones are only set when that specific thing is happening (HCloudRateLimitExceeded, Deleting, RemediationSkipped, RobotRateLimitExceeded), so a missing value is the normal healthy case. The optional feature ones only exist when the feature is turned on (NetworkReady, LoadBalancerReady), so a cluster without that feature never sets them and a missing value is expected. Everything else is a real step of bringing the object up, so a missing value does mean it is not ready yet, and it stays required.
Proposed Solution:
| Resource |
Required (keep in the summary) |
Ignore if missing |
| HetznerCluster |
HCloudTokenAvailable, PlacementGroupsSynced, ControlPlaneEndpointSet, TargetClusterReady, TargetClusterSecretReady |
HCloudRateLimitExceeded, Deleting, NetworkReady (optional feature), LoadBalancerReady (optional feature) |
| HCloudMachine |
HCloudTokenAvailable, ServerCreated, ServerProvisioned, ServerAvailable |
HCloudRateLimitExceeded |
| HCloudRemediation |
HCloudTokenAvailable |
HCloudRateLimitExceeded, RemediationSkipped |
| HetznerBareMetalHost |
RobotCredentialsAvailable, SSHKeysAvailable, RootDeviceHintsValidated, ProvisionSucceeded, NodeBootIDRetrieved |
ActionCompleted, RebootSucceeded, RobotRateLimitExceeded, Deleting |
| HetznerBareMetalMachine |
HCloudTokenAvailable, HostAssociated, HostReady, ServerAvailable |
Deleting |
| HetznerBareMetalRemediation |
none, no Ready summary |
none |
What happens today
Every object we manage (HetznerCluster, HCloudMachine, HetznerBareMetalHost and so on) reports a top level
Readycondition, which is how a user sees whether the object is fully up. We do not setReadyby hand. In CAPI v1beta2 it is a summary of smaller sub conditions, where each sub condition reports one step, for exampleServerCreated,ServerProvisionedandServerAvailableon an HCloudMachine.Readyturns True once the steps it covers are True.CAPI computes that with
NewSummaryCondition, which each controller calls in its scopeClose. We tell it what to summarize through a per resourceSummaryOptsfunction (this one is HCloudMachine's). It has two parts:ForConditionTypesis the list of sub conditions that make upReadyIgnoreTypesIfMissingis the subset by which we tell CAPI to leave a missing one out instead of counting it as Unknown when computingReadyThe problem arises when every condition in
ForConditionTypesis also inIgnoreTypesIfMissingand the object has none of them set yet, the summary has nothing to work with and returnssummary can't be performed when the list of conditions to be summarized is empty. We hit this on a fresh HCloudMachine, whoseSummaryOptslists all five conditions in both lists. The same shape exists on HCloudRemediation and HetznerBareMetalMachine, so they can hit it too.What should happen
Audit each resource's
SummaryOptsand keep a condition inIgnoreTypesIfMissingonly when a missing value does not mean the object is not ready. Every other condition, the real lifecycle steps and the token, stays required.Two kinds of condition pass that test for us. The negative polarity ones are only set when that specific thing is happening (
HCloudRateLimitExceeded,Deleting,RemediationSkipped,RobotRateLimitExceeded), so a missing value is the normal healthy case. The optional feature ones only exist when the feature is turned on (NetworkReady,LoadBalancerReady), so a cluster without that feature never sets them and a missing value is expected. Everything else is a real step of bringing the object up, so a missing value does mean it is not ready yet, and it stays required.Proposed Solution: