Skip to content

Commit

Permalink
Merge pull request #178 from devtron-labs/fix-wrong-ci-status-main
Browse files Browse the repository at this point in the history
fix: fix for wrong ci status for node eviction cases
  • Loading branch information
gireesh-naidu authored Mar 6, 2025
2 parents 139f8af + 1bc93d0 commit 300f68b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions kubewatch/pkg/informer/cluster/systemExec/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ func (impl *InformerImpl) inferFailedReason(eventType string, pod *coreV1.Pod) (
}
t := ctr.State.Terminated
if t == nil {
// We should never get here
impl.logger.Warnf("Pod %s phase was Failed but %s did not have terminated state", pod.Name, ctr.Name)
continue
}
if t.ExitCode == 0 {
// Note: We should never get here
// If we do, it means the pod phase is 'Failed' but the main container state is not in 'terminated' state,

Expand All @@ -193,6 +188,10 @@ func (impl *InformerImpl) inferFailedReason(eventType string, pod *coreV1.Pod) (
continue
}

if t.ExitCode == 0 {
continue
}

msg := fmt.Sprintf("%s (exit code %d)", t.Reason, t.ExitCode)
if t.Message != "" {
msg = fmt.Sprintf("%s: %s", msg, t.Message)
Expand Down

0 comments on commit 300f68b

Please sign in to comment.