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})