-
Notifications
You must be signed in to change notification settings - Fork 260
fix: prevent ipampoolmonitor from reconciling before it receives a nodenetworkconfig #1044
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ee414a8
fix ipampoolmonitor starting before receiving a nodenetworkconfig
rbtr 062d96d
update test
rbtr 3a5721d
update packaging of ipampool and tests
rbtr 53d2695
add big scale-up to e2e to trigger pool scaling
rbtr 80e1ea8
update pool monitor ifaces
rbtr 6b04e90
fix tests
rbtr 0c74193
cleanup and delint
rbtr e68903b
start ipampoolmonitor early for init reconcile
rbtr 6d31aa6
remove cached nnc in pool monitor entirely
rbtr ea14b4d
soft-block on not-initialized-monitor
rbtr bc2a862
test scaler calculations
rbtr 6bc40bb
update e2e scaling and checks
rbtr a2e17aa
put monitor fake back in fakes and cache free min/max
rbtr 1d7f8c5
testify
rbtr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| //go:build !ignore_uncovered | ||
| // +build !ignore_uncovered | ||
|
|
||
| package fakes | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/Azure/azure-container-networking/cns" | ||
| "github.com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha" | ||
| ) | ||
|
|
||
| type MonitorFake struct { | ||
rbtr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| IPsNotInUseCount int | ||
| NodeNetworkConfig *v1alpha.NodeNetworkConfig | ||
| } | ||
|
|
||
| func (*MonitorFake) Start(ctx context.Context) error { | ||
| return nil | ||
| } | ||
|
|
||
| func (f *MonitorFake) Update(nnc *v1alpha.NodeNetworkConfig) { | ||
| f.NodeNetworkConfig = nnc | ||
| } | ||
|
|
||
| func (*MonitorFake) Reconcile() error { | ||
| return nil | ||
| } | ||
|
|
||
| func (f *MonitorFake) GetStateSnapshot() cns.IpamPoolMonitorStateSnapshot { | ||
| return cns.IpamPoolMonitorStateSnapshot{ | ||
| MaximumFreeIps: int(float64(f.NodeNetworkConfig.Status.Scaler.BatchSize) * (float64(f.NodeNetworkConfig.Status.Scaler.ReleaseThresholdPercent) / 100)), //nolint:gomnd // it's a percent | ||
| MinimumFreeIps: int(float64(f.NodeNetworkConfig.Status.Scaler.BatchSize) * (float64(f.NodeNetworkConfig.Status.Scaler.RequestThresholdPercent) / 100)), //nolint:gomnd // it's a percent | ||
| UpdatingIpsNotInUseCount: f.IPsNotInUseCount, | ||
| CachedNNC: *f.NodeNetworkConfig, | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package ipampoolmonitor | ||
| package ipampool | ||
|
|
||
| import ( | ||
| "github.com/prometheus/client_golang/prometheus" | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.