From 7e1df442c2aea1829b1d7b1fe0e4507c57930bac Mon Sep 17 00:00:00 2001 From: Nikita Skrynnik Date: Thu, 5 May 2022 20:06:02 +0700 Subject: [PATCH] apply comments Signed-off-by: Nikita Skrynnik --- pkg/kernel/tools/heal/liveness_check.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/kernel/tools/heal/liveness_check.go b/pkg/kernel/tools/heal/liveness_check.go index ed2eaeec..e8b796fe 100644 --- a/pkg/kernel/tools/heal/liveness_check.go +++ b/pkg/kernel/tools/heal/liveness_check.go @@ -36,8 +36,9 @@ const ( // NewKernelLivenessCheck is an implementation of heal.LivenessCheck. It sends ICMP // ping and checks reply. Returns false if didn't get reply. func NewKernelLivenessCheck(deadlineCtx context.Context, conn *networkservice.Connection) bool { - if mechanism := kernel.ToMechanism(conn.GetMechanism()); mechanism == nil { - log.FromContext(deadlineCtx).Errorf("Ping failed: wrong mechanism type") + if mechanism := conn.GetMechanism().GetType(); mechanism != kernel.MECHANISM { + log.FromContext(deadlineCtx).Errorf("ping is not supported for mechanism %v", mechanism) + return true } p := fastping.NewPinger()