From 2680951bfcd40f874356dae56b72a6fedaa3ab1f Mon Sep 17 00:00:00 2001 From: Jaeryn Date: Fri, 14 Jul 2023 21:32:14 +0000 Subject: [PATCH] fix: return new error when no ncs found in nnc crd --- cns/service/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cns/service/main.go b/cns/service/main.go index cb4bc4bd4b..d4b189e2d1 100644 --- a/cns/service/main.go +++ b/cns/service/main.go @@ -1032,9 +1032,11 @@ func reconcileInitialCNSState(ctx context.Context, cli nodeNetworkConfigGetter, return errors.Wrap(err, "failed to init CNS state: failed to get NNC CRD") } + logger.Printf("Retrieved NNC: %+v", nnc) + // If there are no NCs, we can't initialize our state and we should fail out. if len(nnc.Status.NetworkContainers) == 0 { - return errors.Wrap(err, "failed to init CNS state: no NCs found in NNC CRD") + return errors.New("failed to init CNS state: no NCs found in NNC CRD") } // For each NC, we need to create a CreateNetworkContainerRequest and use it to rebuild our state.