From 613eb90f995277544bc56c98923e890356223c84 Mon Sep 17 00:00:00 2001 From: Claudia Date: Fri, 7 Jun 2024 15:26:14 -0400 Subject: [PATCH] bugfix: abort not parsed Signed-off-by: Claudia --- autopilot-daemon/network/ping-entrypoint.py | 4 ++-- autopilot-daemon/pkg/handlers/healthchecks.go | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/autopilot-daemon/network/ping-entrypoint.py b/autopilot-daemon/network/ping-entrypoint.py index 239516a..8d487ee 100644 --- a/autopilot-daemon/network/ping-entrypoint.py +++ b/autopilot-daemon/network/ping-entrypoint.py @@ -140,8 +140,8 @@ def check_local_ifaces(): ips.append(entry['ips']) ifaces = netifaces.interfaces() ifaces.remove('lo') - ifaces.remove('eth0') - if len(ips) > 0 and len(ifaces) == 0 : + + if len(ips) != len(ifaces) : print("[PING] IFACES count inconsistent. Pod annotation reports", ips, ", not found in the pod among", netifaces.interfaces(),"ABORT") exit() diff --git a/autopilot-daemon/pkg/handlers/healthchecks.go b/autopilot-daemon/pkg/handlers/healthchecks.go index 98dfd7e..a573da0 100644 --- a/autopilot-daemon/pkg/handlers/healthchecks.go +++ b/autopilot-daemon/pkg/handlers/healthchecks.go @@ -244,6 +244,17 @@ func runPing(nodelist string, jobName string, nodelabel string) (*[]byte, error) klog.Error(err.Error()) return nil, err } else { + klog.Info("Ping test completed:") + + if strings.Contains(string(out[:]), "FAIL") { + klog.Info("Ping test failed.", string(out[:])) + } + + if strings.Contains(string(out[:]), "ABORT") { + klog.Info("Ping cannot be run. ", string(out[:])) + return &out, nil + } + output := strings.TrimSuffix(string(out[:]), "\n") lines := strings.Split(output, "\n") unreach_nodes := make(map[string][]string)