From 78cd8c67553f5dd954df3a2a385a2e5d88fe7090 Mon Sep 17 00:00:00 2001 From: Qiyue Yao Date: Mon, 29 Apr 2024 13:22:05 -0700 Subject: [PATCH] Cleanup Signed-off-by: Qiyue Yao --- test/e2e/reachability.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/e2e/reachability.go b/test/e2e/reachability.go index e2deaa11359..a5001fc756d 100644 --- a/test/e2e/reachability.go +++ b/test/e2e/reachability.go @@ -414,11 +414,10 @@ func NewNPEvaluation(pods []Pod) *NPEvaluation { } func (e *NPEvaluation) Expect(from Pod, to Pod, npName string, action string) { - _, ok := e.itemSet[from.String()] - if !ok { + if _, ok := e.itemSet[from.String()]; !ok { panic(fmt.Errorf("key %s not allowed", from)) } - if _, ok = e.itemSet[to.String()]; !ok { + if _, ok := e.itemSet[to.String()]; !ok { panic(fmt.Errorf("key %s not allowed", to)) } e.Truth = append(e.Truth, &NPEvaluationSpec{from, to, npName, action})