Skip to content

Commit eea61cf

Browse files
Removing healthy status condition (#1304)
Fixes #1295 Signed-off-by: Lalatendu Mohanty <[email protected]>
1 parent bc962f1 commit eea61cf

File tree

3 files changed

+0
-36
lines changed

3 files changed

+0
-36
lines changed

api/v1alpha1/clusterextension_types.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ const (
414414
// TODO(user): add more Types, here and into init()
415415
TypeInstalled = "Installed"
416416
TypeResolved = "Resolved"
417-
TypeHealthy = "Healthy"
418417

419418
// TypeDeprecated is a rollup condition that is present when
420419
// any of the deprecated conditions are present.
@@ -447,7 +446,6 @@ func init() {
447446
TypeChannelDeprecated,
448447
TypeBundleDeprecated,
449448
TypeUnpacked,
450-
TypeHealthy,
451449
)
452450
// TODO(user): add Reasons from above
453451
conditionsets.ConditionReasons = append(conditionsets.ConditionReasons,

internal/controllers/clusterextension_controller.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -316,35 +316,13 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
316316
l.V(1).Info("watching managed objects")
317317
cache, err := r.Manager.Get(ctx, ext)
318318
if err != nil {
319-
// If we fail to get the cache, set the Healthy condition to
320-
// "Unknown". We can't know the health of resources we can't monitor
321-
apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{
322-
Type: ocv1alpha1.TypeHealthy,
323-
Reason: ocv1alpha1.ReasonUnverifiable,
324-
Status: metav1.ConditionUnknown,
325-
Message: err.Error(),
326-
ObservedGeneration: ext.Generation,
327-
})
328319
return ctrl.Result{}, err
329320
}
330321

331322
if err := cache.Watch(ctx, r.controller, managedObjs...); err != nil {
332-
// If we fail to establish watches, set the Healthy condition to
333-
// "Unknown". We can't know the health of resources we can't monitor
334-
apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{
335-
Type: ocv1alpha1.TypeHealthy,
336-
Reason: ocv1alpha1.ReasonUnverifiable,
337-
Status: metav1.ConditionUnknown,
338-
Message: err.Error(),
339-
ObservedGeneration: ext.Generation,
340-
})
341323
return ctrl.Result{}, err
342324
}
343325

344-
// If we have successfully established the watches, remove the "Healthy" condition.
345-
// It should be interpreted as "Unknown" when not present.
346-
apimeta.RemoveStatusCondition(&ext.Status.Conditions, ocv1alpha1.TypeHealthy)
347-
348326
return ctrl.Result{}, nil
349327
}
350328

internal/controllers/clusterextension_controller_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -583,12 +583,6 @@ func TestClusterExtensionManagerFailed(t *testing.T) {
583583
require.Equal(t, metav1.ConditionTrue, installedCond.Status)
584584
require.Equal(t, ocv1alpha1.ReasonSuccess, installedCond.Reason)
585585

586-
t.Log("By checking the expected healthy conditions")
587-
managedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeHealthy)
588-
require.NotNil(t, managedCond)
589-
require.Equal(t, metav1.ConditionUnknown, managedCond.Status)
590-
require.Equal(t, ocv1alpha1.ReasonUnverifiable, managedCond.Reason)
591-
592586
require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{}))
593587
}
594588

@@ -683,12 +677,6 @@ func TestClusterExtensionManagedContentCacheWatchFail(t *testing.T) {
683677
require.Equal(t, metav1.ConditionTrue, installedCond.Status)
684678
require.Equal(t, ocv1alpha1.ReasonSuccess, installedCond.Reason)
685679

686-
t.Log("By checking the expected healthy conditions")
687-
managedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1alpha1.TypeHealthy)
688-
require.NotNil(t, managedCond)
689-
require.Equal(t, metav1.ConditionUnknown, managedCond.Status)
690-
require.Equal(t, ocv1alpha1.ReasonUnverifiable, managedCond.Reason)
691-
692680
require.NoError(t, cl.DeleteAllOf(ctx, &ocv1alpha1.ClusterExtension{}))
693681
}
694682

0 commit comments

Comments
 (0)