Skip to content

Commit afb2b3a

Browse files
committed
Fix debugging pods with multiple containers
1 parent 1048dd8 commit afb2b3a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/cmd/cli/cmd/debug.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ func (o *DebugOptions) Debug() error {
344344
return err
345345
}
346346
fmt.Fprintf(o.Attach.Err, "Waiting for pod to start ...\n")
347+
347348
switch containerRunningEvent, err := watch.Until(o.Timeout, w, kclient.PodContainerRunning(o.Attach.ContainerName)); {
348349
// api didn't error right away but the pod wasn't even created
349350
case kapierrors.IsNotFound(err):
@@ -352,8 +353,8 @@ func (o *DebugOptions) Debug() error {
352353
msg += fmt.Sprintf(" on node %q", o.NodeName)
353354
}
354355
return fmt.Errorf(msg)
355-
// switch to logging output
356-
case err == kclient.ErrPodCompleted, !o.Attach.Stdin:
356+
// switch to logging output
357+
case err == kclient.ErrPodCompleted, err == kclient.ErrContainerTerminated, !o.Attach.Stdin:
357358
_, err := kcmd.LogsOptions{
358359
Object: pod,
359360
Options: &kapi.PodLogOptions{

0 commit comments

Comments
 (0)