Skip to content

Conversation

@tyler-lloyd
Copy link
Contributor

Reason for Change:

IPAMv2 can handle update events even when the update is made from CNS itself, like patching
the spec for more IPs. This solves the problem of missed updates when a watch is re-established
and an NNC has been updated in both its spec and status. IPAMv2 is idempotent and will not
fall into a feedback loop where after CNS patches the NNC for more IPs its NNC reconciler still
sees IPs needed so it requests more IPs again, which triggers the reconciler again to request
more IPs, and so on ...

Issue Fixed:

Fixes #3278

Requirements:

Notes:

The first commit is the basic implementation. The 2nd commit does some more refactoring. I am fine to take just the first commit if you all don't like the refactoring attempt.

@tyler-lloyd tyler-lloyd requested a review from a team as a code owner December 18, 2024 21:47
timraymond
timraymond previously approved these changes Dec 19, 2024
Copy link
Member

@timraymond timraymond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me

Group the predicate funcs into either
specific event filters or the "universal"
filters which get applied to every event
type. Then And() them which is what
controller-runtime event_handler is
functionally doing anyway.

link: https://github.com/kubernetes-sigs/controller-runtime/blob/aea2e32a936584b06ae6f7992f856fe7292b0297/pkg/internal/source/event_handler.go#L116
@rbtr rbtr force-pushed the cns-ipamv2-all-updates branch from 985f51e to a001931 Compare January 2, 2025 23:13
Copy link
Collaborator

@rbtr rbtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm let's see how it goes 🧪

@rbtr
Copy link
Collaborator

rbtr commented Jan 7, 2025

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rbtr rbtr added this pull request to the merge queue Jan 7, 2025
Merged via the queue into Azure:master with commit ad6e33a Jan 7, 2025
14 checks passed
sivakami-projects pushed a commit that referenced this pull request Oct 23, 2025
…ns when IPAMv2 is enabled (#3279)

* fix: let NNCReconciler process every update when IPAMv2 is enabled

* refactor: cleanup PredicateFunc usage

Group the predicate funcs into either
specific event filters or the "universal"
filters which get applied to every event
type. Then And() them which is what
controller-runtime event_handler is
functionally doing anyway.

link: https://github.com/kubernetes-sigs/controller-runtime/blob/aea2e32a936584b06ae6f7992f856fe7292b0297/pkg/internal/source/event_handler.go#L116

* revert: "refactor: cleanup PredicateFunc usage"

This reverts commit 67983d0.

* chore: reduce refactoring

* chore: just pass bool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CNS can miss NNC updates when its watch is down

3 participants