Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/hypershift/v1beta1/hostedcluster_conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ const (
ClusterVersionAvailable ConditionType = "ClusterVersionAvailable"
// ClusterVersionReleaseAccepted bubbles up Failing ReleaseAccepted from the CVO.
ClusterVersionReleaseAccepted ConditionType = "ClusterVersionReleaseAccepted"
// ClusterVersionRetrievedUpdates bubbles up RetrievedUpdates from the CVO.
ClusterVersionRetrievedUpdates ConditionType = "ClusterVersionRetrievedUpdates"

// UnmanagedEtcdAvailable indicates whether a user-managed etcd cluster is
// healthy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ func (h *hcpStatusReconciler) reconcile(ctx context.Context, hcp *hyperv1.Hosted
}

cvoConditions := map[hyperv1.ConditionType]*configv1.ClusterOperatorStatusCondition{
hyperv1.ClusterVersionFailing: findClusterOperatorStatusCondition(clusterVersion.Status.Conditions, "Failing"),
hyperv1.ClusterVersionReleaseAccepted: findClusterOperatorStatusCondition(clusterVersion.Status.Conditions, "ReleaseAccepted"),
hyperv1.ClusterVersionProgressing: findClusterOperatorStatusCondition(clusterVersion.Status.Conditions, configv1.OperatorProgressing),
hyperv1.ClusterVersionUpgradeable: findClusterOperatorStatusCondition(clusterVersion.Status.Conditions, configv1.OperatorUpgradeable),
hyperv1.ClusterVersionAvailable: findClusterOperatorStatusCondition(clusterVersion.Status.Conditions, configv1.OperatorAvailable),
hyperv1.ClusterVersionFailing: findClusterOperatorStatusCondition(clusterVersion.Status.Conditions, "Failing"),
hyperv1.ClusterVersionReleaseAccepted: findClusterOperatorStatusCondition(clusterVersion.Status.Conditions, "ReleaseAccepted"),
hyperv1.ClusterVersionRetrievedUpdates: findClusterOperatorStatusCondition(clusterVersion.Status.Conditions, configv1.RetrievedUpdates),
hyperv1.ClusterVersionProgressing: findClusterOperatorStatusCondition(clusterVersion.Status.Conditions, configv1.OperatorProgressing),
hyperv1.ClusterVersionUpgradeable: findClusterOperatorStatusCondition(clusterVersion.Status.Conditions, configv1.OperatorUpgradeable),
hyperv1.ClusterVersionAvailable: findClusterOperatorStatusCondition(clusterVersion.Status.Conditions, configv1.OperatorAvailable),
}

for conditionType, condition := range cvoConditions {
Expand Down
3 changes: 3 additions & 0 deletions docs/content/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3382,6 +3382,9 @@ and kube resource deletion that affects cloud infra like service type load balan
</tr><tr><td><p>&#34;ClusterVersionReleaseAccepted&#34;</p></td>
<td><p>ClusterVersionReleaseAccepted bubbles up Failing ReleaseAccepted from the CVO.</p>
</td>
</tr><tr><td><p>&#34;ClusterVersionRetrievedUpdates&#34;</p></td>
<td><p>ClusterVersionRetrievedUpdates bubbles up RetrievedUpdates from the CVO.</p>
</td>
</tr><tr><td><p>&#34;ClusterVersionSucceeding&#34;</p></td>
<td><p>ClusterVersionSucceeding indicates the current status of the desired release
version of the HostedCluster as indicated by the Failing condition in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,19 +629,21 @@ func (r *HostedClusterReconciler) reconcile(ctx context.Context, req ctrl.Reques

// Copy the CVO conditions from the HCP.
hcpCVOConditions := map[hyperv1.ConditionType]*metav1.Condition{
hyperv1.ClusterVersionSucceeding: nil,
hyperv1.ClusterVersionProgressing: nil,
hyperv1.ClusterVersionReleaseAccepted: nil,
hyperv1.ClusterVersionUpgradeable: nil,
hyperv1.ClusterVersionAvailable: nil,
hyperv1.ClusterVersionSucceeding: nil,
hyperv1.ClusterVersionProgressing: nil,
hyperv1.ClusterVersionReleaseAccepted: nil,
hyperv1.ClusterVersionRetrievedUpdates: nil,
hyperv1.ClusterVersionUpgradeable: nil,
hyperv1.ClusterVersionAvailable: nil,
}
if hcp != nil {
hcpCVOConditions = map[hyperv1.ConditionType]*metav1.Condition{
hyperv1.ClusterVersionSucceeding: meta.FindStatusCondition(hcp.Status.Conditions, string(hyperv1.ClusterVersionFailing)),
hyperv1.ClusterVersionProgressing: meta.FindStatusCondition(hcp.Status.Conditions, string(hyperv1.ClusterVersionProgressing)),
hyperv1.ClusterVersionReleaseAccepted: meta.FindStatusCondition(hcp.Status.Conditions, string(hyperv1.ClusterVersionReleaseAccepted)),
hyperv1.ClusterVersionUpgradeable: meta.FindStatusCondition(hcp.Status.Conditions, string(hyperv1.ClusterVersionUpgradeable)),
hyperv1.ClusterVersionAvailable: meta.FindStatusCondition(hcp.Status.Conditions, string(hyperv1.ClusterVersionAvailable)),
hyperv1.ClusterVersionSucceeding: meta.FindStatusCondition(hcp.Status.Conditions, string(hyperv1.ClusterVersionFailing)),
hyperv1.ClusterVersionProgressing: meta.FindStatusCondition(hcp.Status.Conditions, string(hyperv1.ClusterVersionProgressing)),
hyperv1.ClusterVersionReleaseAccepted: meta.FindStatusCondition(hcp.Status.Conditions, string(hyperv1.ClusterVersionReleaseAccepted)),
hyperv1.ClusterVersionRetrievedUpdates: meta.FindStatusCondition(hcp.Status.Conditions, string(hyperv1.ClusterVersionRetrievedUpdates)),
hyperv1.ClusterVersionUpgradeable: meta.FindStatusCondition(hcp.Status.Conditions, string(hyperv1.ClusterVersionUpgradeable)),
hyperv1.ClusterVersionAvailable: meta.FindStatusCondition(hcp.Status.Conditions, string(hyperv1.ClusterVersionAvailable)),
}
}

Expand Down Expand Up @@ -681,6 +683,12 @@ func (r *HostedClusterReconciler) reconcile(ctx context.Context, req ctrl.Reques
}
}

if hcCVOCondition.Type == string(hyperv1.ClusterVersionRetrievedUpdates) && hcCVOCondition.Reason == hyperv1.StatusUnknownReason {
// until all HostedControlPlane controllers understand how to propagate this condition, avoid bothering folks with unknown status in HostedCluster conditions.
meta.RemoveStatusCondition(&hcluster.Status.Conditions, string(hyperv1.ClusterVersionRetrievedUpdates))
continue
}

meta.SetStatusCondition(&hcluster.Status.Conditions, *hcCVOCondition)
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.