mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-09 10:47:35 +00:00
Merge pull request #103 from skeeey/update-unknow-condition
update managed cluster unknown condition message
This commit is contained in:
@@ -108,11 +108,10 @@ func (c *leaseController) sync(ctx context.Context, syncCtx factory.SyncContext)
|
||||
|
||||
// the lease is not constantly updated, update it to unknown
|
||||
conditionUpdateFn := helpers.UpdateManagedClusterConditionFn(metav1.Condition{
|
||||
Type: clusterv1.ManagedClusterConditionAvailable,
|
||||
Status: metav1.ConditionUnknown,
|
||||
Reason: "ManagedClusterLeaseUpdateStopped",
|
||||
Message: fmt.Sprintf("Registration agent stopped updating its lease within %.0f minutes.",
|
||||
now.Sub(observedLease.Spec.RenewTime.Time).Minutes()),
|
||||
Type: clusterv1.ManagedClusterConditionAvailable,
|
||||
Status: metav1.ConditionUnknown,
|
||||
Reason: "ManagedClusterLeaseUpdateStopped",
|
||||
Message: fmt.Sprintf("Registration agent stopped updating its lease."),
|
||||
})
|
||||
_, updated, err := helpers.UpdateManagedClusterStatus(ctx, c.clusterClient, cluster.Name, conditionUpdateFn)
|
||||
if err != nil {
|
||||
|
||||
@@ -53,7 +53,7 @@ func TestSync(t *testing.T) {
|
||||
Type: clusterv1.ManagedClusterConditionAvailable,
|
||||
Status: metav1.ConditionUnknown,
|
||||
Reason: "ManagedClusterLeaseUpdateStopped",
|
||||
Message: "Registration agent stopped updating its lease within 5 minutes.",
|
||||
Message: "Registration agent stopped updating its lease.",
|
||||
}
|
||||
testinghelpers.AssertActions(t, clusterActions, "get", "update")
|
||||
actual := clusterActions[1].(clienttesting.UpdateActionImpl).Object
|
||||
|
||||
Reference in New Issue
Block a user