Skip to content

Commit 300f68b

Browse files
Merge pull request #178 from devtron-labs/fix-wrong-ci-status-main
fix: fix for wrong ci status for node eviction cases
2 parents 139f8af + 1bc93d0 commit 300f68b

File tree

1 file changed

+4
-5
lines changed
  • kubewatch/pkg/informer/cluster/systemExec

1 file changed

+4
-5
lines changed

kubewatch/pkg/informer/cluster/systemExec/helper.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,6 @@ func (impl *InformerImpl) inferFailedReason(eventType string, pod *coreV1.Pod) (
169169
}
170170
t := ctr.State.Terminated
171171
if t == nil {
172-
// We should never get here
173-
impl.logger.Warnf("Pod %s phase was Failed but %s did not have terminated state", pod.Name, ctr.Name)
174-
continue
175-
}
176-
if t.ExitCode == 0 {
177172
// Note: We should never get here
178173
// If we do, it means the pod phase is 'Failed' but the main container state is not in 'terminated' state,
179174

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

191+
if t.ExitCode == 0 {
192+
continue
193+
}
194+
196195
msg := fmt.Sprintf("%s (exit code %d)", t.Reason, t.ExitCode)
197196
if t.Message != "" {
198197
msg = fmt.Sprintf("%s: %s", msg, t.Message)

0 commit comments

Comments
 (0)