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

Replacing comparison of proto messages #601

Merged
merged 2 commits into from
Nov 27, 2020

Conversation

glazychev-art
Copy link
Contributor

Signed-off-by: Artem Glazychev artem.glazychev@xored.com

Fixes #565

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

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?

Copy link
Contributor Author

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

}
}

func TestOneNSELabelsMatching(t *testing.T) {
Copy link
Member

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>
@denis-tingaikin denis-tingaikin merged commit 76a93c0 into networkservicemesh:master Nov 27, 2020
nsmbot pushed a commit to networkservicemesh/sdk-kernel that referenced this pull request Nov 27, 2020
…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>
nsmbot pushed a commit to networkservicemesh/cmd-registry-memory that referenced this pull request Nov 27, 2020
…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>
nsmbot pushed a commit to networkservicemesh/sdk-vpp that referenced this pull request Nov 27, 2020
…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>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Nov 27, 2020
…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>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr that referenced this pull request Nov 27, 2020
…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>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr-proxy that referenced this pull request Nov 27, 2020
…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>
nsmbot pushed a commit to networkservicemesh/cmd-nse-icmp-responder that referenced this pull request Nov 27, 2020
…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>
nsmbot pushed a commit to networkservicemesh/sdk-vppagent that referenced this pull request Nov 27, 2020
…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>
illbegood pushed a commit to illbegood/sdk that referenced this pull request Dec 20, 2020
* 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>
illbegood pushed a commit to illbegood/sdk that referenced this pull request Dec 20, 2020
* 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>
illbegood pushed a commit to illbegood/sdk that referenced this pull request Dec 23, 2020
* 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>
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.

Do not compare protomessages via reflect.DeepEqual
2 participants