Skip to content

Commit

Permalink
Merge pull request #443 from bjwswang/main
Browse files Browse the repository at this point in the history
feat: add a new intermediate status OfflineInProgress
  • Loading branch information
bjwswang authored Dec 25, 2023
2 parents a53c15f + eb6100a commit 8ef1b78
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apiserver/pkg/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,14 @@ func GetObjStatus(obj client.Object) string {
// Worker can better represent the state of resources through Reason.
v := obj.(*v1alpha1.Worker)
condition = v.Status.GetCondition(v1alpha1.TypeReady)
return string(condition.Reason)
status := string(condition.Reason)
// When replicas is zero but status is not `Offline`, it must be in `OfflineInProgress`
if v.Spec.Replicas == nil || *v.Spec.Replicas == 0 {
if status != "Offline" {
status = "OfflineInProgress"
}
}
return status
case "Application":
v := obj.(*v1alpha1.Application)
condition = v.Status.GetCondition(v1alpha1.TypeReady)
Expand Down

0 comments on commit 8ef1b78

Please sign in to comment.