Skip to content

Commit

Permalink
fix(tenantop): move time.Sleep to the end of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI committed Sep 26, 2024
1 parent 94648e4 commit 68963be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/resource/obtenantoperation/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ func (m *ObTenantOperationManager) waitForOBTenantToBeStatus(waitSeconds int, ma
return errors.New("target tenant is nil")
}
for i := 0; i < waitSeconds; i++ {
time.Sleep(time.Second)
tenant := &v1alpha1.OBTenant{}
err := m.Client.Get(m.Ctx, types.NamespacedName{
Namespace: m.Resource.Namespace,
Expand All @@ -101,6 +100,7 @@ func (m *ObTenantOperationManager) waitForOBTenantToBeStatus(waitSeconds int, ma
if matcher(tenant) {
return nil
}
time.Sleep(time.Second)
}
return errors.Errorf("wait for tenant %s to be in desired status timeout", m.Resource.Name)
}

0 comments on commit 68963be

Please sign in to comment.