Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: let NNCResonciler process update events with different generations when IPAMv2 is enabled #3279

Merged
merged 5 commits into from
Jan 7, 2025

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

cns/service/main.go Show resolved Hide resolved
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
Contributor

@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
Contributor

rbtr commented Jan 7, 2025

/azp run Azure Container Networking PR

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
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