Skip to content

Commit 243863d

Browse files
jaer-tsunJaeryn
andcommitted
fix: return new error when no ncs found in nnc crd (#2061)
Co-authored-by: Jaeryn <[email protected]>
1 parent a1b90ca commit 243863d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cns/service/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,9 +1008,11 @@ func reconcileInitialCNSState(ctx context.Context, cli nodeNetworkConfigGetter,
10081008
return errors.Wrap(err, "failed to init CNS state: failed to get NNC CRD")
10091009
}
10101010

1011+
logger.Printf("Retrieved NNC: %+v", nnc)
1012+
10111013
// If there are no NCs, we can't initialize our state and we should fail out.
10121014
if len(nnc.Status.NetworkContainers) == 0 {
1013-
return errors.Wrap(err, "failed to init CNS state: no NCs found in NNC CRD")
1015+
return errors.New("failed to init CNS state: no NCs found in NNC CRD")
10141016
}
10151017

10161018
// For each NC, we need to create a CreateNetworkContainerRequest and use it to rebuild our state.

0 commit comments

Comments
 (0)