-
Notifications
You must be signed in to change notification settings - Fork 260
Don't overwrite Spec in IPAM PoolMonitor from NNC again after initialization #1328
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
Conversation
neaggarwMS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
neaggarwMS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
cns/ipampool/monitor.go
Outdated
| } | ||
|
|
||
| func (pm *Monitor) reconcile(ctx context.Context) error { | ||
| pm.mu.Lock() // lock the monitor to prevent scaling races |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to the caller before you read pm.Spec
| pm.metastate.minFreeCount, pm.metastate.maxFreeCount = CalculateMinFreeIPs(scaler), CalculateMaxFreeIPs(scaler) | ||
| pm.once.Do(func() { close(pm.started) }) // close the init channel the first time we receive a NodeNetworkConfig. | ||
| pm.once.Do(func() { | ||
| pm.spec = nnc.Spec // set the spec from the NNC initially (afterwards we write the Spec so we know target state). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a log line here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add a log line in func (pm *Monitor) Update(nnc *v1alpha.NodeNetworkConfig) error { function.
… NNC Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
… NNC (Azure#1328) Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
Signed-off-by: Evan Baker rbtr@users.noreply.github.com
Reason for Change:
After init, the PoolMonitor writes the Spec, so it has the target state locally and should not let the NNC updates it receives overwrite that local state.
Issue Fixed:
Requirements:
Notes: