diff --git a/api/hypershift/v1beta1/hostedcluster_conditions.go b/api/hypershift/v1beta1/hostedcluster_conditions.go index a1591734253..150959cd84a 100644 --- a/api/hypershift/v1beta1/hostedcluster_conditions.go +++ b/api/hypershift/v1beta1/hostedcluster_conditions.go @@ -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. diff --git a/control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go b/control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go index 87cf2f81d42..f2144a165fa 100644 --- a/control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go +++ b/control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go @@ -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 { diff --git a/docs/content/reference/api.md b/docs/content/reference/api.md index 0c092ed7622..145d03925e4 100644 --- a/docs/content/reference/api.md +++ b/docs/content/reference/api.md @@ -3382,6 +3382,9 @@ and kube resource deletion that affects cloud infra like service type load balan

"ClusterVersionReleaseAccepted"

ClusterVersionReleaseAccepted bubbles up Failing ReleaseAccepted from the CVO.

+

"ClusterVersionRetrievedUpdates"

+

ClusterVersionRetrievedUpdates bubbles up RetrievedUpdates from the CVO.

+

"ClusterVersionSucceeding"

ClusterVersionSucceeding indicates the current status of the desired release version of the HostedCluster as indicated by the Failing condition in the diff --git a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go index c6f807acd82..2e5c280a62c 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go @@ -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)), } } @@ -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) } diff --git a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_conditions.go b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_conditions.go index a1591734253..150959cd84a 100644 --- a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_conditions.go +++ b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_conditions.go @@ -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.