Skip to content

Commit

Permalink
fix: init container failing report
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Jan 18, 2023
1 parent 1d6cf85 commit 6d41fb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/output/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (o Output) errorOutputFrom(err error) *errorOutput {
Type: ErrorTypeRollout,
}

if errOut.Code == status.FailureProcessCrashing {
if errOut.Code == status.FailureProcessCrashing && re.Namespace != "" && re.Pod != "" && re.Container != "" {
logBytes, err := o.wrapper.TrailContainerLogs(re.Namespace, re.Pod, re.Container)
if err != nil {
return o.errorOutputFrom(err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/status/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestPodStatus(pod *v1.Pod, options *config.Options, resourceType ResourceTy
for _, initStatus := range pod.Status.InitContainerStatuses {
status := TestContainerStatus(&initStatus, options, resourceType)
if status.Error != nil {
if !status.Continue {
if !status.Continue || resourceType == ResourceTypeJob {
if re, ok := status.Error.(RolloutError); ok {
re.Namespace = pod.Namespace
re.Pod = pod.Name
Expand All @@ -32,7 +32,7 @@ func TestPodStatus(pod *v1.Pod, options *config.Options, resourceType ResourceTy
for _, containerStatus := range pod.Status.ContainerStatuses {
status := TestContainerStatus(&containerStatus, options, resourceType)
if status.Error != nil {
if !status.Continue {
if !status.Continue || resourceType == ResourceTypeJob {
if re, ok := status.Error.(RolloutError); ok {
re.Namespace = pod.Namespace
re.Pod = pod.Name
Expand Down

0 comments on commit 6d41fb8

Please sign in to comment.