Skip to content

Commit dc37cef

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

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
@@ -1032,9 +1032,11 @@ func reconcileInitialCNSState(ctx context.Context, cli nodeNetworkConfigGetter,
10321032
return errors.Wrap(err, "failed to init CNS state: failed to get NNC CRD")
10331033
}
10341034

1035+
logger.Printf("Retrieved NNC: %+v", nnc)
1036+
10351037
// If there are no NCs, we can't initialize our state and we should fail out.
10361038
if len(nnc.Status.NetworkContainers) == 0 {
1037-
return errors.Wrap(err, "failed to init CNS state: no NCs found in NNC CRD")
1039+
return errors.New("failed to init CNS state: no NCs found in NNC CRD")
10381040
}
10391041

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

0 commit comments

Comments
 (0)