From 0a015913e12e2eff2813e0f90e22f31ce1cd2028 Mon Sep 17 00:00:00 2001 From: Pavithra Ramesh Date: Mon, 20 Jul 2020 16:44:41 -0700 Subject: [PATCH] Handle error when calculating endpoints for NEG. --- pkg/neg/syncers/transaction.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/neg/syncers/transaction.go b/pkg/neg/syncers/transaction.go index 6f83cd3a99..872b25539a 100644 --- a/pkg/neg/syncers/transaction.go +++ b/pkg/neg/syncers/transaction.go @@ -163,6 +163,9 @@ func (s *transactionSyncer) syncInternal() error { s.logStats(currentMap, "after in-progress operations have completed, NEG endpoints") targetMap, endpointPodMap, err := s.endpointsCalculator.CalculateEndpoints(ep.(*apiv1.Endpoints), currentMap) + if err != nil { + return fmt.Errorf("endpoints calculation error in mode %q, err: %v", s.endpointsCalculator.Mode(), err) + } s.logStats(targetMap, "desired NEG endpoints") // Calculate the endpoints to add and delete to transform the current state to desire state