Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cns/kubecontroller/nodenetworkconfig/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager, node *v1.Node) error {
return ue.ObjectOld.GetGeneration() == ue.ObjectNew.GetGeneration()
},
}).
WithEventFilter(predicate.NewPredicateFuncs(func(object client.Object) bool {
// only process events on objects that are not being deleted.
return object.GetDeletionTimestamp().IsZero()
})).
Complete(r)
if err != nil {
return errors.Wrap(err, "failed to set up reconciler with manager")
Expand Down
3 changes: 3 additions & 0 deletions cns/service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,9 @@ func reconcileInitialCNSState(ctx context.Context, cli nodeNetworkConfigGetter,
}

logger.Printf("Retrieved NNC: %+v", nnc)
if !nnc.DeletionTimestamp.IsZero() {
return errors.New("failed to init CNS state: NNC is being deleted")
}

// If there are no NCs, we can't initialize our state and we should fail out.
if len(nnc.Status.NetworkContainers) == 0 {
Expand Down