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

Add options to the forwarder to use it with an external vpp #530

Merged
merged 2 commits into from
Mar 18, 2022

Conversation

glazychev-art
Copy link
Contributor

Issue: networkservicemesh/integration-k8s-kind#325

Signed-off-by: Artem Glazychev [email protected]

@glazychev-art glazychev-art marked this pull request as draft March 16, 2022 12:27
@glazychev-art glazychev-art marked this pull request as ready for review March 17, 2022 06:40
@glazychev-art glazychev-art changed the title [Draft] Add options to the forwarder to use it with an external vpp Add options to the forwarder to use it with an external vpp Mar 17, 2022
func NewServer(ctx context.Context, name string, authzServer networkservice.NetworkServiceServer, tokenGenerator token.GeneratorFunc, clientURL *url.URL, vppConn Connection, tunnelIP net.IP, tunnelPort uint16, dialTimeout time.Duration, domain2Device map[string]string, clientDialOptions ...grpc.DialOption) endpoint.Endpoint {
nseClient := registryclient.NewNetworkServiceEndpointRegistryClient(ctx, clientURL,
func NewServer(ctx context.Context, tokenGenerator token.GeneratorFunc, vppConn Connection, tunnelIP net.IP, options ...Option) endpoint.Endpoint {
opts := &forwarderOptions{
Copy link
Member

@denis-tingaikin denis-tingaikin Mar 17, 2022

Choose a reason for hiding this comment

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

Missed default parameters for:

authorizeServer -> null server
clientURL -> default connectTo
dialTimeout   ->  200ms
domain2Device  ->empty map

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought it was the responsibility of each individual chain element. Forwarder just passes options. Otherwise, it will turn out that at each iteration we will set new default parameters:

func AnyOtherNewServer(opts ...Options) {
  /* set default parameters */
  ...
  forwarder.NewServer(..., forwarder.WithOption(opts.AnyOption)) <- new default parameters inside forwarder.NewServer
  ...
}

Name is set, because we want to keep consistency inside the forwarder (used in the client and endpoint chain).
And, do we have a constant for dialTimeout or clientURL?

@denis-tingaikin Any thoughts?

Copy link
Member

@denis-tingaikin denis-tingaikin Mar 17, 2022

Choose a reason for hiding this comment

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

@glazychev-art option means that the value is not required. I don't think that clientURL== nil and dialTimeout == 0 are good values by default. Also I'm fine to make these values as required.

Signed-off-by: Artem Glazychev <[email protected]>
@denis-tingaikin denis-tingaikin merged commit 9984c7c into networkservicemesh:main Mar 18, 2022
nsmbot pushed a commit to networkservicemesh/cmd-nse-firewall-vpp that referenced this pull request Mar 18, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#530

Commit: 9984c7c
Author: Artem Glazychev
Date: 2022-03-18 15:04:18 +0700
Message:
  - Add options to the forwarder to use it with an external vpp (#530)
* Add options to the forwarder to use it with an external vpp

Signed-off-by: Artem Glazychev <[email protected]>

* Add default values

Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nsc-vpp that referenced this pull request Mar 18, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#530

Commit: 9984c7c
Author: Artem Glazychev
Date: 2022-03-18 15:04:18 +0700
Message:
  - Add options to the forwarder to use it with an external vpp (#530)
* Add options to the forwarder to use it with an external vpp

Signed-off-by: Artem Glazychev <[email protected]>

* Add default values

Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nse-icmp-responder-vpp that referenced this pull request Mar 18, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#530

Commit: 9984c7c
Author: Artem Glazychev
Date: 2022-03-18 15:04:18 +0700
Message:
  - Add options to the forwarder to use it with an external vpp (#530)
* Add options to the forwarder to use it with an external vpp

Signed-off-by: Artem Glazychev <[email protected]>

* Add default values

Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-forwarder-vpp that referenced this pull request Mar 18, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#530

Commit: 9984c7c
Author: Artem Glazychev
Date: 2022-03-18 15:04:18 +0700
Message:
  - Add options to the forwarder to use it with an external vpp (#530)
* Add options to the forwarder to use it with an external vpp

Signed-off-by: Artem Glazychev <[email protected]>

* Add default values

Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vlan-vpp that referenced this pull request Mar 18, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#530

Commit: 9984c7c
Author: Artem Glazychev
Date: 2022-03-18 15:04:18 +0700
Message:
  - Add options to the forwarder to use it with an external vpp (#530)
* Add options to the forwarder to use it with an external vpp

Signed-off-by: Artem Glazychev <[email protected]>

* Add default values

Signed-off-by: NSMBot <[email protected]>
edwarnicke pushed a commit to networkservicemesh/cmd-forwarder-vpp that referenced this pull request Mar 20, 2022
* Update go.mod and go.sum to latest version from networkservicemesh/sdk-vpp@main
PR link: networkservicemesh/sdk-vpp#530

Commit: 9984c7c
Author: Artem Glazychev
Date: 2022-03-18 15:04:18 +0700
Message:
  - Add options to the forwarder to use it with an external vpp (#530)
* Add options to the forwarder to use it with an external vpp

Signed-off-by: Artem Glazychev <[email protected]>

* Add default values

Signed-off-by: NSMBot <[email protected]>

* Update forwarder to use it with an external vpp

Signed-off-by: Artem Glazychev <[email protected]>

* Use vpp instead of vpp-ext

Signed-off-by: Artem Glazychev <[email protected]>

Co-authored-by: NSMBot <[email protected]>
Co-authored-by: Network Service Mesh Bot <[email protected]>
nsmbot pushed a commit to networkservicemesh/deployments-k8s that referenced this pull request Mar 20, 2022
…d-forwarder-vpp@main

PR link: networkservicemesh/cmd-forwarder-vpp#530

Commit: f80658e
Author: Artem Glazychev
Date: 2022-03-21 04:39:18 +0700
Message:
  - Update forwarder to use it with an external vpp (#530)
* Update go.mod and go.sum to latest version from networkservicemesh/sdk-vpp@main
PR link: networkservicemesh/sdk-vpp#530

Commit: 9984c7c
Author: Artem Glazychev
Date: 2022-03-18 15:04:18 +0700
Message:
    - Add options to the forwarder to use it with an external vpp (#530)
* Add options to the forwarder to use it with an external vpp

Signed-off-by: Artem Glazychev <[email protected]>

* Add default values

Signed-off-by: NSMBot <[email protected]>

* Update forwarder to use it with an external vpp

Signed-off-by: Artem Glazychev <[email protected]>

* Use vpp instead of vpp-ext

Signed-off-by: Artem Glazychev <[email protected]>

Co-authored-by: NSMBot <[email protected]>
Signed-off-by: NSMBot <[email protected]>
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