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

Update registry client #491

Merged
merged 2 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/edwarnicke/serialize v1.0.7
github.com/kelseyhightower/envconfig v1.4.0
github.com/networkservicemesh/api v1.3.2-0.20220512020524-c57fd2623351
github.com/networkservicemesh/sdk v0.5.1-0.20220512021617-3a175e308a18
github.com/networkservicemesh/sdk v0.5.1-0.20220512090615-4f565a9784e0
github.com/sirupsen/logrus v1.8.1
github.com/spiffe/go-spiffe/v2 v2.0.0
github.com/stretchr/testify v1.7.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS
github.com/nats-io/stan.go v0.10.2/go.mod h1:vo2ax8K2IxaR3JtEMLZRFKIdoK/3o1/PKueapB7ezX0=
github.com/networkservicemesh/api v1.3.2-0.20220512020524-c57fd2623351 h1:xkwnRaajnnqFPEbj5FrVVDjSgp+o5tiHqVb8W5cOAfI=
github.com/networkservicemesh/api v1.3.2-0.20220512020524-c57fd2623351/go.mod h1:hOF2844BSstH1311oDMDgqqXS+kdc77htZNPRKl9mf8=
github.com/networkservicemesh/sdk v0.5.1-0.20220512021617-3a175e308a18 h1:gHQmGN6YFwGWkM7cxrUuB1BV2L0qvPkkyIl/Cq19gtw=
github.com/networkservicemesh/sdk v0.5.1-0.20220512021617-3a175e308a18/go.mod h1:gOYlqDYMdIMCIAfl257+Jn8KNHKVQDZjRIvYSA6wH9s=
github.com/networkservicemesh/sdk v0.5.1-0.20220512090615-4f565a9784e0 h1:7ObtZZ4na7PIkco8XTIiGTgh9FhvDtTqKHTS1epR5HI=
github.com/networkservicemesh/sdk v0.5.1-0.20220512090615-4f565a9784e0/go.mod h1:gOYlqDYMdIMCIAfl257+Jn8KNHKVQDZjRIvYSA6wH9s=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
Expand Down
17 changes: 12 additions & 5 deletions test/client_endpoint_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2021 Doc.ai and/or its affiliates.
// Copyright (c) 2020-2022 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -68,12 +68,15 @@ type myEndpouint struct {
func newCrossNSE(ctx context.Context, name string, connectTo *url.URL, tokenGenerator token.GeneratorFunc, clientDialOptions ...grpc.DialOption) endpoint.Endpoint {
var crossNSe = &myEndpouint{}
nseClient := chain.NewNetworkServiceEndpointRegistryClient(
registryclient.NewNetworkServiceEndpointRegistryClient(ctx, connectTo,
registryclient.NewNetworkServiceEndpointRegistryClient(ctx,
registryclient.WithClientURL(connectTo),
registryclient.WithNSEAdditionalFunctionality(recvfd.NewNetworkServiceEndpointRegistryClient()),
registryclient.WithDialOptions(clientDialOptions...),
),
)
nsClient := registryclient.NewNetworkServiceRegistryClient(ctx, connectTo, registryclient.WithDialOptions(clientDialOptions...))
nsClient := registryclient.NewNetworkServiceRegistryClient(ctx,
registryclient.WithClientURL(connectTo),
registryclient.WithDialOptions(clientDialOptions...))

crossNSe.Endpoint = endpoint.NewServer(ctx, tokenGenerator,
endpoint.WithName(name),
Expand Down Expand Up @@ -124,8 +127,12 @@ func (f *NsmgrTestSuite) TestNSmgrEndpointSendFD() {
require.NotNil(t, nseErr)
require.NotNil(t, nseGRPC)

nsRegClient := registryclient.NewNetworkServiceRegistryClient(ctx, &setup.configuration.ListenOn[0], registryclient.WithDialOptions(setup.dialOptions()...))
nseRegClient := registryclient.NewNetworkServiceEndpointRegistryClient(ctx, &setup.configuration.ListenOn[0], registryclient.WithDialOptions(setup.dialOptions()...))
nsRegClient := registryclient.NewNetworkServiceRegistryClient(ctx,
registryclient.WithClientURL(&setup.configuration.ListenOn[0]),
registryclient.WithDialOptions(setup.dialOptions()...))
nseRegClient := registryclient.NewNetworkServiceEndpointRegistryClient(ctx,
registryclient.WithClientURL(&setup.configuration.ListenOn[0]),
registryclient.WithDialOptions(setup.dialOptions()...))
logrus.Infof("Register network service")
ns, nserr := nsRegClient.Register(context.Background(), &registry.NetworkService{
Name: "my-service",
Expand Down