-
Notifications
You must be signed in to change notification settings - Fork 36
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 event system in vl3 client #1598
Fix event system in vl3 client #1598
Conversation
Signed-off-by: NikitaSkrynnik <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1598 +/- ##
=======================================
Coverage ? 67.28%
=======================================
Files ? 262
Lines ? 12456
Branches ? 0
=======================================
Hits ? 8381
Misses ? 3552
Partials ? 523 ☔ View full report in Codecov by Sentry. |
Signed-off-by: NikitaSkrynnik <[email protected]>
Signed-off-by: NikitaSkrynnik <[email protected]>
@@ -32,6 +32,39 @@ type IPAM struct { | |||
ipPool *ippool.IPPool | |||
excludedPrefixes map[string]struct{} | |||
clientMask uint8 | |||
subscriptions []chan<- struct{} |
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.
subscriptions []chan<- struct{} | |
subscriptions []func() |
} | ||
|
||
// Subscribe creates a subscription for receiving events about changed prefixes | ||
func (p *IPAM) Subscribe(ch chan<- struct{}) { |
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.
func (p *IPAM) Subscribe(ch chan<- struct{}) { | |
func (p *IPAM) Subscribe(action unc()) context.CancelFunc { |
@@ -142,6 +175,7 @@ func (p *IPAM) Reset(ctx context.Context, prefix string, excludePrefies []string | |||
p.ipPool.ExcludeString(excludePrefix) | |||
p.excludedPrefixes[excludePrefix] = struct{}{} | |||
} | |||
p.notify() |
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.
p.notify() | |
p.notify() // run each sunbscriber |
Issue link
networkservicemesh/cmd-nse-vl3-vpp#289
https://github.com/networkservicemesh/integration-k8s-kind/actions/runs/8377013129/job/22938067943?pr=995
How Has This Been Tested?
Types of changes