-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add options to the forwarder to use it with an external vpp #530
Conversation
7d9604f
to
1de021c
Compare
Signed-off-by: Artem Glazychev <[email protected]>
1de021c
to
6da782a
Compare
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{ |
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.
Missed default parameters for:
authorizeServer -> null server
clientURL -> default connectTo
dialTimeout -> 200ms
domain2Device ->empty map
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.
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?
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.
@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]>
…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]>
…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]>
…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]>
…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]>
…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]>
* 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]>
…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]>
Issue: networkservicemesh/integration-k8s-kind#325
Signed-off-by: Artem Glazychev [email protected]