Skip to content

Commit

Permalink
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 Jul 12, 2022
1 parent 1454390 commit 5c93d2b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ linters-settings:
threshold: 150
funlen:
Lines: 300
Statements: 120
Statements: 125
goconst:
min-len: 2
min-occurrences: 2
Expand Down
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ require (
github.com/edwarnicke/grpcfd v1.1.2
github.com/edwarnicke/vpphelper v0.0.0-20210225052320-b4f1f1aff45d
github.com/kelseyhightower/envconfig v1.4.0
github.com/networkservicemesh/api v1.4.1-0.20220705145838-0b96f94a2adb
github.com/networkservicemesh/sdk v0.5.1-0.20220706093325-9d885cffbc5c
github.com/networkservicemesh/api v1.4.1-0.20220711153918-a59689088578
github.com/networkservicemesh/sdk v0.5.1-0.20220711213025-454062d8cea6
github.com/networkservicemesh/sdk-vpp v0.0.0-20220706094402-72181b4b3611
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.1
Expand All @@ -17,8 +17,6 @@ require (
google.golang.org/protobuf v1.27.1
)

replace github.com/networkservicemesh/sdk => github.com/denis-tingaikin/sdk v0.0.0-20220710232041-6f8a30e5811d

require (
git.fd.io/govpp.git v0.3.6-0.20210927044411-385ccc0d8ba9 // indirect
github.com/OneOfOne/xxhash v1.2.3 // indirect
Expand Down
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denis-tingaikin/sdk v0.0.0-20220710232041-6f8a30e5811d h1:brJ70rhvOWPAdeYI5BZXBS1NCb6guF/VeV2owWm+7T4=
github.com/denis-tingaikin/sdk v0.0.0-20220710232041-6f8a30e5811d/go.mod h1:FdmGiefBBcj9HlV+poQSEAPOuBVp/hkwjWoDEN2a+jg=
github.com/edwarnicke/exechelper v1.0.2 h1:dD49Ui2U0FBFxxhalnKw6vLS0P0TkgnXBRvKL/xmC5w=
github.com/edwarnicke/exechelper v1.0.2/go.mod h1:/T271jtNX/ND4De6pa2aRy2+8sNtyCDB1A2pp4M+fUs=
github.com/edwarnicke/govpp v0.0.0-20220509171552-731995b8f574 h1:2lYhLBDjflBOPJLd/42txk9QlSkVep6p1vKzlvkCKOI=
Expand Down Expand Up @@ -136,10 +134,10 @@ github.com/miekg/dns v1.1.49 h1:qe0mQU3Z/XpFeE+AEBo2rqaS1IPBJ3anmqZ4XiZJVG8=
github.com/miekg/dns v1.1.49/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME=
github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc=
github.com/mna/pigeon v0.0.0-20180808201053-bb0192cfc2ae/go.mod h1:Iym28+kJVnC1hfQvv5MUtI6AiFFzvQjHcvI4RFTG/04=
github.com/networkservicemesh/api v1.4.1-0.20220705145838-0b96f94a2adb h1:ElGI/wElHXwyZ3Fu7G6GoZTxlHFMck1T7Lt8DlMVz8M=
github.com/networkservicemesh/api v1.4.1-0.20220705145838-0b96f94a2adb/go.mod h1:hOF2844BSstH1311oDMDgqqXS+kdc77htZNPRKl9mf8=
github.com/networkservicemesh/sdk v0.5.1-0.20220706093325-9d885cffbc5c h1:0G9CkmRKxrc0L27C5Y2B0eplEAX4OpTYl6O5th3jzQc=
github.com/networkservicemesh/sdk v0.5.1-0.20220706093325-9d885cffbc5c/go.mod h1:VnnL68V5mIqpVQBInPJWIE8wsA9VVobHiDmNE3ZAl3Q=
github.com/networkservicemesh/api v1.4.1-0.20220711153918-a59689088578 h1:2MZD6SGFULqTgMKA8BFy7F+ldRErAyxsWht7oCwCVRM=
github.com/networkservicemesh/api v1.4.1-0.20220711153918-a59689088578/go.mod h1:hOF2844BSstH1311oDMDgqqXS+kdc77htZNPRKl9mf8=
github.com/networkservicemesh/sdk v0.5.1-0.20220711213025-454062d8cea6 h1:wz6G5+rIqMZqGAII9DdSAuR1LzstTvMpxsaYnHyBjjg=
github.com/networkservicemesh/sdk v0.5.1-0.20220711213025-454062d8cea6/go.mod h1:BF31hkvYPBmpChr4XB2l9pFWK+ySvk2y2h7IdCwqt84=
github.com/networkservicemesh/sdk-kernel v0.0.0-20220706093902-9d98b29132d8 h1:A9HzxIHbU9nyS84eZKVrFa15NO6wNK5W0jYPUcHml2o=
github.com/networkservicemesh/sdk-kernel v0.0.0-20220706093902-9d98b29132d8/go.mod h1:j1LsLxUiCjio4xuRSOusOMXiGMJhuUosvzKp1R5pcfo=
github.com/networkservicemesh/sdk-vpp v0.0.0-20220706094402-72181b4b3611 h1:Xgyo0ZaCUvzBy0bMdxcSqU/GP3FxbbkJgnRChiKmQZ4=
Expand Down
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func main() {
requestCtx, cancelRequest := context.WithTimeout(signalCtx, config.RequestTimeout)
defer cancelRequest()

conn, err := nsmClient.Request(ctx, &networkservice.NetworkServiceRequest{
conn, err := nsmClient.Request(requestCtx, &networkservice.NetworkServiceRequest{
Connection: &networkservice.Connection{
Id: config.Name + "-kernel",
NetworkServiceEndpointName: config.Name,
Expand All @@ -400,6 +400,12 @@ func main() {
log.FromContext(ctx).Fatal(err.Error())
}

defer func(conn *networkservice.Connection) {
closeCtx, cancelClose := context.WithTimeout(ctx, config.RequestTimeout)
defer cancelClose()
_, _ = nsmClient.Close(closeCtx, conn)
}(conn)

dnsServerIP.Store(conn.GetContext().GetIpContext().GetSrcIPNets()[0].IP)

for i, nse := range nseList {
Expand Down

0 comments on commit 5c93d2b

Please sign in to comment.