Check for either Docker or Containerd getting active for e2e_node tests

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas
2020-06-16 20:06:37 -04:00
parent fbb4bb0003
commit 01183e51f0
2 changed files with 7 additions and 14 deletions

View File

@@ -668,13 +668,15 @@ func createInstance(imageConfig *internalGCEImage) (string, error) {
// TODO(random-liu): Remove the docker version check. Use some other command to check
// instance readiness.
var output string
output, err = remote.SSH(name, "docker", "version")
output, err = remote.SSH(name, "sh", "-c",
"'systemctl list-units --type=service --state=running | grep -e docker -e containerd'")
if err != nil {
err = fmt.Errorf("instance %s not running docker daemon - Command failed: %s", name, output)
err = fmt.Errorf("instance %s not running docker/containerd daemon - Command failed: %s", name, output)
continue
}
if !strings.Contains(output, "Server") {
err = fmt.Errorf("instance %s not running docker daemon - Server not found: %s", name, output)
if !strings.Contains(output, "docker.service") &&
!strings.Contains(output, "containerd.service") {
err = fmt.Errorf("instance %s not running docker/containerd daemon: %s", name, output)
continue
}
instanceRunning = true