Skip to content

Commit

Permalink
fix: crash loop pod - ignore more errors when trying to stop container
Browse files Browse the repository at this point in the history
  • Loading branch information
ReuDa committed Dec 8, 2023
1 parent fa561af commit b031c46
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extpod/attack_cause_crashloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ func runKubectlExec(namespace, podName, containerName string, kubeExecCmd []stri
log.Debug().Str("container", containerName).Str("pod", podName).Msg("Cannot exec in a stopped state. Skipping.")
return nil
}
if strings.Contains(output, "cannot exec in a stopped container") {
log.Debug().Str("container", containerName).Str("pod", podName).Msg("Cannot exec in a stopped container. Skipping.")
return nil
}
if strings.Contains(output, "container is in CONTAINER_EXITED state") {
log.Debug().Str("container", containerName).Str("pod", podName).Msg("Container is in CONTAINER_EXITED state. Skipping.")
return nil
Expand Down

0 comments on commit b031c46

Please sign in to comment.