diff --git a/api/v1beta1/cluster_types.go b/api/v1beta1/cluster_types.go index 8e94aa136da4..23ceaf2d30fb 100644 --- a/api/v1beta1/cluster_types.go +++ b/api/v1beta1/cluster_types.go @@ -269,10 +269,10 @@ const ( ClusterRemoteConnectionProbeV1Beta2Condition = "RemoteConnectionProbe" // ClusterRemoteConnectionProbeFailedV1Beta2Reason surfaces issues with the connection to the workload cluster. - ClusterRemoteConnectionProbeFailedV1Beta2Reason = "RemoteConnectionProbeFailed" + ClusterRemoteConnectionProbeFailedV1Beta2Reason = "ProbeFailed" // ClusterRemoteConnectionProbeSucceededV1Beta2Reason is used to report a working connection with the workload cluster. - ClusterRemoteConnectionProbeSucceededV1Beta2Reason = "RemoteConnectionProbeSucceeded" + ClusterRemoteConnectionProbeSucceededV1Beta2Reason = "ProbeSucceeded" ) // Cluster's ScalingUp condition and corresponding reasons that will be used in v1Beta2 API version. diff --git a/internal/controllers/cluster/cluster_controller.go b/internal/controllers/cluster/cluster_controller.go index 8cde31540cce..16693da639ba 100644 --- a/internal/controllers/cluster/cluster_controller.go +++ b/internal/controllers/cluster/cluster_controller.go @@ -63,9 +63,6 @@ const ( // deleteRequeueAfter is how long to wait before checking again to see if the cluster still has children during // deletion. deleteRequeueAfter = 5 * time.Second - - // remoteConnectionProbeSucceededMessage is the message to be used when remote connection probe succeeded. - remoteConnectionProbeSucceededMessage = "Remote connection probe succeeded" ) // Update permissions on /finalizers subresrouce is required on management clusters with 'OwnerReferencesPermissionEnforcement' plugin enabled. @@ -203,10 +200,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (retRes ct }) } else { v1beta2conditions.Set(cluster, metav1.Condition{ - Type: clusterv1.ClusterRemoteConnectionProbeV1Beta2Condition, - Status: metav1.ConditionTrue, - Reason: clusterv1.ClusterRemoteConnectionProbeSucceededV1Beta2Reason, - Message: remoteConnectionProbeSucceededMessage, + Type: clusterv1.ClusterRemoteConnectionProbeV1Beta2Condition, + Status: metav1.ConditionTrue, + Reason: clusterv1.ClusterRemoteConnectionProbeSucceededV1Beta2Reason, }) } diff --git a/internal/controllers/cluster/cluster_controller_status.go b/internal/controllers/cluster/cluster_controller_status.go index a24adf769185..cfb140fb6a56 100644 --- a/internal/controllers/cluster/cluster_controller_status.go +++ b/internal/controllers/cluster/cluster_controller_status.go @@ -969,10 +969,6 @@ func setAvailableCondition(ctx context.Context, cluster *clusterv1.Cluster) { overrideConditions = append(overrideConditions, *controlPlaneAvailableCondition) } - if remoteConnectionProbeCondition := calculateRemoteConnectionProbeForSummary(cluster); remoteConnectionProbeCondition != nil { - overrideConditions = append(overrideConditions, *remoteConnectionProbeCondition) - } - if len(overrideConditions) > 0 { summaryOpts = append(summaryOpts, overrideConditions) } @@ -1053,31 +1049,6 @@ func calculateControlPlaneAvailableForSummary(cluster *clusterv1.Cluster) *v1bet } } -func calculateRemoteConnectionProbeForSummary(cluster *clusterv1.Cluster) *v1beta2conditions.ConditionWithOwnerInfo { - remoteConnectionProbeCondition := v1beta2conditions.Get(cluster, clusterv1.ClusterRemoteConnectionProbeV1Beta2Condition) - if remoteConnectionProbeCondition == nil { - return nil - } - - message := remoteConnectionProbeCondition.Message - if remoteConnectionProbeCondition.Status == metav1.ConditionTrue && remoteConnectionProbeCondition.Message == remoteConnectionProbeSucceededMessage { - message = "" - } - - return &v1beta2conditions.ConditionWithOwnerInfo{ - OwnerResource: v1beta2conditions.ConditionOwnerInfo{ - Kind: "Cluster", - Name: cluster.Name, - }, - Condition: metav1.Condition{ - Type: remoteConnectionProbeCondition.Type, - Status: remoteConnectionProbeCondition.Status, - Reason: remoteConnectionProbeCondition.Reason, - Message: message, - }, - } -} - func aggregateUnhealthyMachines(machines collections.Machines) string { if len(machines) == 0 { return "" diff --git a/internal/controllers/cluster/cluster_controller_status_test.go b/internal/controllers/cluster/cluster_controller_status_test.go index 729ee9aea0ac..a7b55e782aa6 100644 --- a/internal/controllers/cluster/cluster_controller_status_test.go +++ b/internal/controllers/cluster/cluster_controller_status_test.go @@ -1980,7 +1980,7 @@ func TestSetAvailableCondition(t *testing.T) { }, }, { - name: "Drops messages from InfraCluster and ControlPlane when using fallback to fields; drop message from RemoteConnectionProbe when true", + name: "Drops messages from InfraCluster and ControlPlane when using fallback to fields", cluster: &clusterv1.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: "machine-test", @@ -2013,10 +2013,9 @@ func TestSetAvailableCondition(t *testing.T) { Reason: "Foo", }, { - Type: clusterv1.ClusterRemoteConnectionProbeV1Beta2Condition, - Status: metav1.ConditionTrue, - Reason: clusterv1.ClusterRemoteConnectionProbeSucceededV1Beta2Reason, - Message: remoteConnectionProbeSucceededMessage, + Type: clusterv1.ClusterRemoteConnectionProbeV1Beta2Condition, + Status: metav1.ConditionTrue, + Reason: clusterv1.ClusterRemoteConnectionProbeSucceededV1Beta2Reason, }, { Type: clusterv1.ClusterDeletingV1Beta2Condition,