Skip to content

Commit

Permalink
FIX:issue52, if a pod is runnning but not ready(about readiness probe…
Browse files Browse the repository at this point in the history
…), we can connect (#62)
  • Loading branch information
calmkart authored and aylei committed Sep 26, 2019
1 parent 3b7576c commit 6a30d78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/plugin/cmd.go
Expand Up @@ -488,8 +488,9 @@ func (o *DebugOptions) getContainerIDByName(pod *corev1.Pod, containerName strin
if containerStatus.Name != containerName {
continue
}
if !containerStatus.Ready {
return "", fmt.Errorf("container [%s] not ready", containerName)
// #52 if a pod is running but not ready(because of readiness probe), we can connect
if containerStatus.State.Running == nil {
return "", fmt.Errorf("container [%s] not running", containerName)
}
return containerStatus.ContainerID, nil
}
Expand Down

0 comments on commit 6a30d78

Please sign in to comment.