-
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
Replacing comparison of proto messages #601
Conversation
(left.ExpirationTime == nil || left.ExpirationTime.Seconds == right.ExpirationTime.Seconds) && | ||
(left.NetworkServiceNames == nil || contains(right.NetworkServiceNames, left.NetworkServiceNames)) && | ||
(left.Url == "" || strings.Contains(right.Url, left.Url)) | ||
} | ||
|
||
func contains(what, where []string) bool { | ||
func labelsContains(where, what map[string]*registry.NetworkServiceLabels) bool { |
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.
Could you cover this by tests?
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.
Yes, new commit was added
pkg/tools/matchutils/utils_test.go
Outdated
} | ||
} | ||
|
||
func TestOneNSELabelsMatching(t *testing.T) { |
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.
Could you use memory registry server and cover this via Find API?
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
…k@master networkservicemesh/sdk#601 networkservicemesh/sdk PR link: networkservicemesh/sdk#601 networkservicemesh/sdk commit message: commit 76a93c05a11e4e83b99f241517dbb9cd35f489e7 Author: Artem Glazychev <artem.glazychev@xored.com> Date: Fri Nov 27 13:47:28 2020 +0700 Replacing comparison of proto messages (#601) * Replacing comparison of proto messages Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Add tests for network service endpoints matching by label Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#601 networkservicemesh/sdk PR link: networkservicemesh/sdk#601 networkservicemesh/sdk commit message: commit 76a93c05a11e4e83b99f241517dbb9cd35f489e7 Author: Artem Glazychev <artem.glazychev@xored.com> Date: Fri Nov 27 13:47:28 2020 +0700 Replacing comparison of proto messages (#601) * Replacing comparison of proto messages Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Add tests for network service endpoints matching by label Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#601 networkservicemesh/sdk PR link: networkservicemesh/sdk#601 networkservicemesh/sdk commit message: commit 76a93c05a11e4e83b99f241517dbb9cd35f489e7 Author: Artem Glazychev <artem.glazychev@xored.com> Date: Fri Nov 27 13:47:28 2020 +0700 Replacing comparison of proto messages (#601) * Replacing comparison of proto messages Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Add tests for network service endpoints matching by label Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#601 networkservicemesh/sdk PR link: networkservicemesh/sdk#601 networkservicemesh/sdk commit message: commit 76a93c05a11e4e83b99f241517dbb9cd35f489e7 Author: Artem Glazychev <artem.glazychev@xored.com> Date: Fri Nov 27 13:47:28 2020 +0700 Replacing comparison of proto messages (#601) * Replacing comparison of proto messages Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Add tests for network service endpoints matching by label Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#601 networkservicemesh/sdk PR link: networkservicemesh/sdk#601 networkservicemesh/sdk commit message: commit 76a93c05a11e4e83b99f241517dbb9cd35f489e7 Author: Artem Glazychev <artem.glazychev@xored.com> Date: Fri Nov 27 13:47:28 2020 +0700 Replacing comparison of proto messages (#601) * Replacing comparison of proto messages Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Add tests for network service endpoints matching by label Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#601 networkservicemesh/sdk PR link: networkservicemesh/sdk#601 networkservicemesh/sdk commit message: commit 76a93c05a11e4e83b99f241517dbb9cd35f489e7 Author: Artem Glazychev <artem.glazychev@xored.com> Date: Fri Nov 27 13:47:28 2020 +0700 Replacing comparison of proto messages (#601) * Replacing comparison of proto messages Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Add tests for network service endpoints matching by label Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#601 networkservicemesh/sdk PR link: networkservicemesh/sdk#601 networkservicemesh/sdk commit message: commit 76a93c05a11e4e83b99f241517dbb9cd35f489e7 Author: Artem Glazychev <artem.glazychev@xored.com> Date: Fri Nov 27 13:47:28 2020 +0700 Replacing comparison of proto messages (#601) * Replacing comparison of proto messages Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Add tests for network service endpoints matching by label Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@master networkservicemesh/sdk#601 networkservicemesh/sdk PR link: networkservicemesh/sdk#601 networkservicemesh/sdk commit message: commit 76a93c05a11e4e83b99f241517dbb9cd35f489e7 Author: Artem Glazychev <artem.glazychev@xored.com> Date: Fri Nov 27 13:47:28 2020 +0700 Replacing comparison of proto messages (#601) * Replacing comparison of proto messages Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Add tests for network service endpoints matching by label Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
* Replacing comparison of proto messages Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Add tests for network service endpoints matching by label Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: Sergey Ershov <sergey.ershov@xored.com>
* Replacing comparison of proto messages Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Add tests for network service endpoints matching by label Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: Sergey Ershov <sergey.ershov@xored.com>
* Replacing comparison of proto messages Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Add tests for network service endpoints matching by label Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: Sergey Ershov <sergey.ershov@xored.com>
Signed-off-by: Artem Glazychev artem.glazychev@xored.com
Fixes #565