Skip to content

Commit

Permalink
manually update to latest sdk
Browse files Browse the repository at this point in the history
Signed-off-by: denis-tingaikin <denis.tingajkin@xored.com>
  • Loading branch information
denis-tingaikin committed Nov 9, 2021
1 parent 1e43bab commit 969bd44
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 11 deletions.
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ go 1.16
require (
git.fd.io/govpp.git v0.3.6-0.20210927044411-385ccc0d8ba9
github.com/antonfisher/nested-logrus-formatter v1.3.1
github.com/boltdb/bolt v1.3.1 // indirect
github.com/edwarnicke/debug v1.0.0
github.com/edwarnicke/exechelper v1.0.3
github.com/edwarnicke/govpp v0.0.0-20211023203533-76f2c92be8d5
github.com/edwarnicke/grpcfd v0.1.1
github.com/edwarnicke/vpphelper v0.0.0-20210512223648-f914b171f679
github.com/golang/protobuf v1.5.2
github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea // indirect
github.com/kelseyhightower/envconfig v1.4.0
github.com/networkservicemesh/api v1.0.1-0.20211108174538-15c88bce33f3
github.com/networkservicemesh/sdk v0.5.1-0.20211108225443-65796945d24d
Expand All @@ -26,3 +28,5 @@ require (
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae
google.golang.org/grpc v1.38.0
)

replace github.com/networkservicemesh/sdk-vpp => ../sdk-vpp
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB
github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
Expand Down Expand Up @@ -259,6 +260,7 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/raft v1.3.1/go.mod h1:4Ak7FSPnuvmb0GV6vgIAJ4vYT4bek9bb6Q+7HVbyzqM=
github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
Expand Down Expand Up @@ -346,14 +348,18 @@ github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/nats-io/stan.go v0.10.0/go.mod h1:0jEuBXKauB1HHJswHM/lx05K48TJ1Yxj6VIfM4k+aB4=
github.com/networkservicemesh/api v1.0.1-0.20211103090613-64784f3465ce/go.mod h1:B6meq/SWjWR6bGXZdXPfbOeaBK+T1JayLdtEJQCsXKU=
github.com/networkservicemesh/api v1.0.1-0.20211105145309-b0e47249449a/go.mod h1:B6meq/SWjWR6bGXZdXPfbOeaBK+T1JayLdtEJQCsXKU=
github.com/networkservicemesh/api v1.0.1-0.20211108174538-15c88bce33f3 h1:/fqve5/MSxuxeD5uhy8u2UElhHB8erkghvZvgeojClU=
github.com/networkservicemesh/api v1.0.1-0.20211108174538-15c88bce33f3/go.mod h1:B6meq/SWjWR6bGXZdXPfbOeaBK+T1JayLdtEJQCsXKU=
github.com/networkservicemesh/sdk v0.5.1-0.20211103091303-7c4cfcd913b8/go.mod h1:LcfybR5YvHlf1f3P/BvOi1WW6TQCHyb7B9zlgmo+YvI=
github.com/networkservicemesh/sdk v0.5.1-0.20211108062646-a0eb20d2f936/go.mod h1:avXlSwFwY8rfjJrTwuxwQFJY8dhZ7Nq/6JpaVJFXDM0=
github.com/networkservicemesh/sdk v0.5.1-0.20211108225443-65796945d24d h1:BoWsZOKlgVckGppw4pBzBo4ydAmFLCJpyqZV3niTc1A=
github.com/networkservicemesh/sdk v0.5.1-0.20211108225443-65796945d24d/go.mod h1:fl6NjUK8+m+z7B1yoA0AowE0BpvjazfX0PQvr2gDnho=
github.com/networkservicemesh/sdk-k8s v0.0.0-20211103091718-33b5af79cf03 h1:zRQEYK50TYbPa3VKxNocm48kZex8v5EqVs+YThOFOb8=
github.com/networkservicemesh/sdk-k8s v0.0.0-20211103091718-33b5af79cf03/go.mod h1:00UFcAw3OeU3J6mOPUCXTwYIeraP4XbdM9DHFaGEr3I=
github.com/networkservicemesh/sdk-kernel v0.0.0-20211103091648-fc8bfe254113/go.mod h1:s9tYSINEUkCIDMPq8tNFQ2zxMwjgXEcCKfcp4gStycU=
github.com/networkservicemesh/sdk-kernel v0.0.0-20211108062918-bd58c7777bdb h1:Ys1ACpgg7XSDt5kbi9bXeNXF3oG6gik2kvAP+vRktl0=
github.com/networkservicemesh/sdk-kernel v0.0.0-20211108062918-bd58c7777bdb/go.mod h1:TWn6VzxvBRUNZcg/jw8iP31MYQdegCg8XEcP/2fFdjI=
github.com/networkservicemesh/sdk-kernel v0.0.0-20211108225859-2db0822a1c14 h1:tINlsmqGRXE0/IkKk1pS7+PFqTZreWdWqN3yN545dew=
github.com/networkservicemesh/sdk-kernel v0.0.0-20211108225859-2db0822a1c14/go.mod h1:u7vQCgUUT0DzW0xVFadc8p8ItGmgDB5Ho2qke3ewdnQ=
github.com/networkservicemesh/sdk-sriov v0.0.0-20211103092011-23a720ab62a6 h1:WsnwJeTDbTVJc8FuCYIUt6y9QnYaRrEyH3TCycQGDRo=
Expand Down
13 changes: 7 additions & 6 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ import (

// Config - configuration for cmd-forwarder-vpp
type Config struct {
Name string `default:"forwarder" desc:"Name of Endpoint"`
NSName string `default:"xconnectns" desc:"Name of Network Service to Register with Registry"`
ConnectTo url.URL `default:"unix:///connect.to.socket" desc:"url to connect to" split_words:"true"`
ListenOn url.URL `default:"unix:///listen.on.socket" desc:"url to listen on" split_words:"true"`
MaxTokenLifetime time.Duration `default:"10m" desc:"maximum lifetime of tokens" split_words:"true"`
LogLevel string `default:"INFO" desc:"Log level" split_words:"true"`
Name string `default:"forwarder" desc:"Name of Endpoint"`
Labels map[string]string `desc:"Labels related to this forwarder-vpp instance"`
NSName string `default:"forwarder" desc:"Name of Network Service to Register with Registry"`
ConnectTo url.URL `default:"unix:///connect.to.socket" desc:"url to connect to" split_words:"true"`
ListenOn url.URL `default:"unix:///listen.on.socket" desc:"url to listen on" split_words:"true"`
MaxTokenLifetime time.Duration `default:"10m" desc:"maximum lifetime of tokens" split_words:"true"`
LogLevel string `default:"INFO" desc:"Log level" split_words:"true"`

TunnelIP net.IP `desc:"IP to use for tunnels" split_words:"true"`
VxlanPort uint16 `default:"0" desc:"VXLAN port to use" split_words:"true"`
Expand Down
1 change: 0 additions & 1 deletion internal/imports/imports_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions internal/xconnectns/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"github.com/networkservicemesh/sdk-sriov/pkg/networkservice/common/resourcepool"
sriovconfig "github.com/networkservicemesh/sdk-sriov/pkg/sriov/config"
sriovtokens "github.com/networkservicemesh/sdk-sriov/pkg/tools/tokens"
vppxconnectns "github.com/networkservicemesh/sdk-vpp/pkg/networkservice/chains/xconnectns"
vppforwarder "github.com/networkservicemesh/sdk-vpp/pkg/networkservice/chains/forwarder"
"github.com/networkservicemesh/sdk/pkg/networkservice/chains/endpoint"
"github.com/networkservicemesh/sdk/pkg/networkservice/common/mechanisms"
"github.com/networkservicemesh/sdk/pkg/networkservice/common/switchcase"
Expand All @@ -50,7 +50,7 @@ func NewServer(
name string,
authzServer networkservice.NetworkServiceServer,
tokenGenerator token.GeneratorFunc,
vppConn vppxconnectns.Connection,
vppConn vppforwarder.Connection,
tunnelIP net.IP,
tunnelPort uint16,
pciPool resourcepool.PCIPool,
Expand All @@ -60,7 +60,7 @@ func NewServer(
clientURL *url.URL,
clientDialOptions ...grpc.DialOption,
) endpoint.Endpoint {
vppForwarder := vppxconnectns.NewServer(ctx, name, authzServer, tokenGenerator, clientURL, vppConn, tunnelIP, tunnelPort, clientDialOptions...)
vppForwarder := vppforwarder.NewServer(ctx, name, authzServer, tokenGenerator, clientURL, vppConn, tunnelIP, tunnelPort, clientDialOptions...)
if sriovConfig == nil {
return vppForwarder
}
Expand Down
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,12 @@ func main() {

registryClient := registryclient.NewNetworkServiceEndpointRegistryClient(ctx, &cfg.ConnectTo, registryclient.WithDialOptions(clientOptions...))
_, err = registryClient.Register(ctx, &registryapi.NetworkServiceEndpoint{
Name: cfg.Name,
Name: cfg.Name,
NetworkServiceLabels: map[string]*registryapi.NetworkServiceLabels{
cfg.NSName: &registryapi.NetworkServiceLabels{
Labels: cfg.Labels,
},
},
NetworkServiceNames: []string{cfg.NSName},
Url: cfg.ListenOn.String(),
})
Expand Down

0 comments on commit 969bd44

Please sign in to comment.