diff --git a/api/v1alpha1/clusterextension_types.go b/api/v1alpha1/clusterextension_types.go index 433f37859..6628fe1ed 100644 --- a/api/v1alpha1/clusterextension_types.go +++ b/api/v1alpha1/clusterextension_types.go @@ -414,7 +414,6 @@ const ( // TODO(user): add more Types, here and into init() TypeInstalled = "Installed" TypeResolved = "Resolved" - TypeHealthy = "Healthy" // TypeDeprecated is a rollup condition that is present when // any of the deprecated conditions are present. @@ -447,7 +446,6 @@ func init() { TypeChannelDeprecated, TypeBundleDeprecated, TypeUnpacked, - TypeHealthy, ) // TODO(user): add Reasons from above conditionsets.ConditionReasons = append(conditionsets.ConditionReasons, diff --git a/internal/controllers/clusterextension_controller.go b/internal/controllers/clusterextension_controller.go index 6e06f849d..8cb8eeeb8 100644 --- a/internal/controllers/clusterextension_controller.go +++ b/internal/controllers/clusterextension_controller.go @@ -316,35 +316,13 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp l.V(1).Info("watching managed objects") cache, err := r.Manager.Get(ctx, ext) if err != nil { - // If we fail to get the cache, set the Healthy condition to - // "Unknown". We can't know the health of resources we can't monitor - apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{ - Type: ocv1alpha1.TypeHealthy, - Reason: ocv1alpha1.ReasonUnverifiable, - Status: metav1.ConditionUnknown, - Message: err.Error(), - ObservedGeneration: ext.Generation, - }) return ctrl.Result{}, err } if err := cache.Watch(ctx, r.controller, managedObjs...); err != nil { - // If we fail to establish watches, set the Healthy condition to - // "Unknown". We can't know the health of resources we can't monitor - apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{ - Type: ocv1alpha1.TypeHealthy, - Reason: ocv1alpha1.ReasonUnverifiable, - Status: metav1.ConditionUnknown, - Message: err.Error(), - ObservedGeneration: ext.Generation, - }) return ctrl.Result{}, err } - // If we have successfully established the watches, remove the "Healthy" condition. - // It should be interpreted as "Unknown" when not present. - apimeta.RemoveStatusCondition(&ext.Status.Conditions, ocv1alpha1.TypeHealthy) - return ctrl.Result{}, nil } diff --git a/internal/controllers/clusterextension_controller_test.go b/internal/controllers/clusterextension_controller_test.go index 60be87deb..0042e339e 100644 --- a/internal/controllers/clusterextension_controller_test.go +++ b/internal/controllers/clusterextension_controller_test.go @@ -583,12 +583,6 @@ func TestClusterExtensionManagerFailed(t *testing.T) { require.Equal(t, metav1.ConditionTrue, installedCond.Status) require.Equal(t, ocv1alpha1.ReasonSuccess, installedCond.Reason) - t.Log("By checking the expected healthy conditions") - managedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeHealthy) - require.NotNil(t, managedCond) - require.Equal(t, metav1.ConditionUnknown, managedCond.Status) - require.Equal(t, ocv1alpha1.ReasonUnverifiable, managedCond.Reason) - require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{})) } @@ -683,12 +677,6 @@ func TestClusterExtensionManagedContentCacheWatchFail(t *testing.T) { require.Equal(t, metav1.ConditionTrue, installedCond.Status) require.Equal(t, ocv1alpha1.ReasonSuccess, installedCond.Reason) - t.Log("By checking the expected healthy conditions") - managedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeHealthy) - require.NotNil(t, managedCond) - require.Equal(t, metav1.ConditionUnknown, managedCond.Status) - require.Equal(t, ocv1alpha1.ReasonUnverifiable, managedCond.Reason) - require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{})) }