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 event system in vl3 client #1598

Closed

Conversation

NikitaSkrynnik
Copy link
Contributor

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?

  • Added unit testing to cover
  • Tested manually
  • Tested by integration testing
  • Have not tested

Types of changes

  • Bug fix
  • New functionality
  • Documentation
  • Refactoring
  • CI

Signed-off-by: NikitaSkrynnik <[email protected]>
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 4 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (main@f5e9a5c). Click here to learn what that means.

Files Patch % Lines
...orkservice/connectioncontext/ipcontext/vl3/ipam.go 80.95% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

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{}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
subscriptions []chan<- struct{}
subscriptions []func()

}

// Subscribe creates a subscription for receiving events about changed prefixes
func (p *IPAM) Subscribe(ch chan<- struct{}) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
p.notify()
p.notify() // run each sunbscriber

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.

2 participants