Skip to content

Commit

Permalink
fix unknown states
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <[email protected]>
  • Loading branch information
odubajDT committed Feb 29, 2024
1 parent 88672ed commit 1f0ed52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lifecycle-operator/apis/lifecycle/v1beta1/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1f0ed52

Please sign in to comment.