diff --git a/lifecycle-operator/apis/lifecycle/v1beta1/common/common.go b/lifecycle-operator/apis/lifecycle/v1beta1/common/common.go index fc8870ceed..aa60e84d64 100644 --- a/lifecycle-operator/apis/lifecycle/v1beta1/common/common.go +++ b/lifecycle-operator/apis/lifecycle/v1beta1/common/common.go @@ -124,9 +124,12 @@ func GetOverallState(s StatusSummary) KeptnState { if s.Pending > 0 { return StatePending } - if s.Unknown > 0 || s.GetTotalCount() != s.Total { + if s.Unknown > 0 { return StateUnknown } + if s.GetTotalCount() != s.Total { + return StatePending + } return StateSucceeded } diff --git a/lifecycle-operator/apis/lifecycle/v1beta1/common/common_test.go b/lifecycle-operator/apis/lifecycle/v1beta1/common/common_test.go index 02cea6084e..49ef0a99a8 100644 --- a/lifecycle-operator/apis/lifecycle/v1beta1/common/common_test.go +++ b/lifecycle-operator/apis/lifecycle/v1beta1/common/common_test.go @@ -257,6 +257,11 @@ func Test_GeOverallState(t *testing.T) { Summary: StatusSummary{1, 0, 0, 1, 0, 0, 0}, Want: StateSucceeded, }, + { + Name: "pending total count", + Summary: StatusSummary{2, 0, 0, 1, 0, 0, 0}, + Want: StatePending, + }, } for _, tt := range tests { t.Run(tt.Name, func(t *testing.T) {