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

added client for setting connection context for passthrough nse #883

Closed
wants to merge 0 commits into from

Conversation

Mixaster995
Copy link
Contributor

Signed-off-by: Mikhail avramenkomihail15@gmail.com
#879

@Mixaster995 Mixaster995 force-pushed the master branch 2 times, most recently from 37a05ef to d453d4a Compare April 29, 2021 05:07
@Mixaster995 Mixaster995 marked this pull request as ready for review April 29, 2021 10:23
@denis-tingaikin denis-tingaikin marked this pull request as draft May 4, 2021 15:19
@Mixaster995 Mixaster995 force-pushed the master branch 2 times, most recently from d41f289 to bd04ccc Compare May 5, 2021 09:27
@Mixaster995 Mixaster995 marked this pull request as ready for review May 5, 2021 09:34
}

// NewSetConnectionContextClient - returns client that changes connection context to one, provided as parameter or default if nil provided
func NewSetConnectionContextClient() networkservice.NetworkServiceClient {
Copy link
Member

Choose a reason for hiding this comment

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

NewSetConnectionContextClient

Suggested change
func NewSetConnectionContextClient() networkservice.NetworkServiceClient {
func NewClient() networkservice.NetworkServiceClient {

}

func (s *setConCtxClient) Close(ctx context.Context, conn *networkservice.Connection, opts ...grpc.CallOption) (*empty.Empty, error) {
return next.Client(ctx).Close(ctx, conn, opts...)
Copy link
Member

Choose a reason for hiding this comment

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

Why we do nothing on close?

// limitations under the License.

// Package injectconncontext changes connection context in client chain
package injectconncontext
Copy link
Member

Choose a reason for hiding this comment

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

Why we can not store this chain element near the test?

pkg/networkservice/chains/nsmgr/utils_test.go Outdated Show resolved Hide resolved
client.WithName(fmt.Sprintf("nsc-%v", uuid.New().String())),
client.WithAdditionalFunctionality(
checkconnection.NewClient(t, func(t *testing.T, conn *networkservice.Connection) {
assert.True(t, proto.Equal(connCtx, conn.Context))
Copy link
Member

Choose a reason for hiding this comment

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

Is diff missed?

Comment on lines 545 to 546
checkconnection.NewClient(t, func(t *testing.T, conn *networkservice.Connection) {
assert.True(t, proto.Equal(connCtx, conn.Context))
Copy link
Member

@denis-tingaikin denis-tingaikin May 5, 2021

Choose a reason for hiding this comment

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

I think we need to have two checks:

  1. Check that contextContext is updated on backward(before translation client).
  2. Check that contextContext is updated on forward ( after translation client).

Comment on lines 548 to 553
checkrequest.NewClient(t, func(t *testing.T, request *networkservice.NetworkServiceRequest) {
if *requestCount > 0 {
assert.Equal(
t,
connCtx.String(),
request.GetConnection().Context.String(),
Copy link
Member

Choose a reason for hiding this comment

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

Why it is needed?

@edwarnicke
Copy link
Member

I'm a little unclear why this client for setting connection context for passthrough NSE is needed at all...

@denis-tingaikin
Copy link
Member

/cc @Bolodya1997

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.

5 participants