diff --git a/go.mod b/go.mod index c398c916..35ae63c5 100644 --- a/go.mod +++ b/go.mod @@ -14,10 +14,10 @@ require ( github.com/google/uuid v1.2.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/networkservicemesh/api v1.6.2-0.20221205183940-84c7ff837cdd - github.com/networkservicemesh/sdk v0.5.1-0.20221206103812-b6979bfe147d + github.com/networkservicemesh/sdk v0.5.1-0.20221207123638-d94a145092d6 github.com/networkservicemesh/sdk-k8s v0.0.0-20221207123727-3fd96c399bba github.com/networkservicemesh/sdk-sriov v0.0.0-20221206105157-ce61d862f46f - github.com/networkservicemesh/sdk-vpp v0.0.0-20221206112452-c9d7291b5e3b + github.com/networkservicemesh/sdk-vpp v0.0.0-20221207124521-0c5429932a90 github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.9.0 github.com/spiffe/go-spiffe/v2 v2.0.0 @@ -51,7 +51,7 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/lunixbochs/struc v0.0.0-20200521075829-a4cb8d33dbbe // indirect - github.com/networkservicemesh/sdk-kernel v0.0.0-20221206104345-fd91dd9e8f6d // indirect + github.com/networkservicemesh/sdk-kernel v0.0.0-20221207123951-e21560e65118 // indirect github.com/open-policy-agent/opa v0.44.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect diff --git a/go.sum b/go.sum index e4b4aafd..8bacd432 100644 --- a/go.sum +++ b/go.sum @@ -230,16 +230,16 @@ github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc= github.com/networkservicemesh/api v1.6.2-0.20221205183940-84c7ff837cdd h1:26HR90HrJFZHIPPP3SCLGNRpPCMFoEnSSZfhHH8MPSo= github.com/networkservicemesh/api v1.6.2-0.20221205183940-84c7ff837cdd/go.mod h1:hOF2844BSstH1311oDMDgqqXS+kdc77htZNPRKl9mf8= -github.com/networkservicemesh/sdk v0.5.1-0.20221206103812-b6979bfe147d h1:m6B7ls2B+c48SNHiXak7HTxB1bs/aX4rmygixFhIlgg= -github.com/networkservicemesh/sdk v0.5.1-0.20221206103812-b6979bfe147d/go.mod h1:zEYFbCVXGlTT5f0x6sx8XtL2GazkYBpCoEpooxkz2vE= +github.com/networkservicemesh/sdk v0.5.1-0.20221207123638-d94a145092d6 h1:d/HQEcyiJ+AJQoBp3S7feCPWNiERI//vUGHE4eX035U= +github.com/networkservicemesh/sdk v0.5.1-0.20221207123638-d94a145092d6/go.mod h1:zEYFbCVXGlTT5f0x6sx8XtL2GazkYBpCoEpooxkz2vE= github.com/networkservicemesh/sdk-k8s v0.0.0-20221207123727-3fd96c399bba h1:Q7wbUaOj/8KIQ9Xn426kr+CUcEXwkdQUqwPTHA5Jbjk= github.com/networkservicemesh/sdk-k8s v0.0.0-20221207123727-3fd96c399bba/go.mod h1:OLZoPHXed6fZ1XKYDDHbsfjLH5GCOx0/rRj+9Wo26Wg= -github.com/networkservicemesh/sdk-kernel v0.0.0-20221206104345-fd91dd9e8f6d h1:enSFaWQzfU2MS90DUh2f5muBLnmL9SxoAKXv4fUNEKY= -github.com/networkservicemesh/sdk-kernel v0.0.0-20221206104345-fd91dd9e8f6d/go.mod h1:t4A46Ph49k1kfuiEUPjmFvnIeaU3cfigQjUxr+gSmwE= +github.com/networkservicemesh/sdk-kernel v0.0.0-20221207123951-e21560e65118 h1:4QgyRhTK5CMMwK0oRbM270KN0RR16B5BfHeZ+yooZ7U= +github.com/networkservicemesh/sdk-kernel v0.0.0-20221207123951-e21560e65118/go.mod h1:DMU7vjqK8WmfAZXWfkqRphwoCF93osI5KvzHk3XhKE0= github.com/networkservicemesh/sdk-sriov v0.0.0-20221206105157-ce61d862f46f h1:WOicK+q0roBwdWQqriWKk3YYqRniVszIAd0FafH2+tg= github.com/networkservicemesh/sdk-sriov v0.0.0-20221206105157-ce61d862f46f/go.mod h1:pVMdEtwTPziKjhbqFEQWpz3DhXfOfJ+FfVyzENdNCb8= -github.com/networkservicemesh/sdk-vpp v0.0.0-20221206112452-c9d7291b5e3b h1:tJrY7VBHaTc6u5BLh3w1cPs362eiSD/dbTxdEWSDVSM= -github.com/networkservicemesh/sdk-vpp v0.0.0-20221206112452-c9d7291b5e3b/go.mod h1:9XCG5+2GxZs2jN9PkQb08iQ2Qg1mx22/OTbtLhpbcxc= +github.com/networkservicemesh/sdk-vpp v0.0.0-20221207124521-0c5429932a90 h1:sCQaCNUZ5B0nMZ6of1rV++JR4Q7pTOxecKwAFmGUMz4= +github.com/networkservicemesh/sdk-vpp v0.0.0-20221207124521-0c5429932a90/go.mod h1:j76iItYVvwFg8q26R/1XkNvcRYyivxGX4Rvx3yhVXmE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.1.0 h1:e3YP4dN/HYPpGh29X1ZkcxcEICsOls9huyVCRBaxjq8= github.com/onsi/gomega v1.1.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= diff --git a/internal/config/config.go b/internal/config/config.go index 0218de66..6d856b54 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -58,7 +58,7 @@ type Config struct { PCIDriversPath string `default:"/sys/bus/pci/drivers" desc:"path to the PCI drivers directory" split_words:"true"` CgroupPath string `default:"/host/sys/fs/cgroup/devices" desc:"path to the host cgroup directory" split_words:"true"` VFIOPath string `default:"/host/dev/vfio" desc:"path to the host VFIO directory" split_words:"true"` - PriorityMechanisms []string `default:"" desc:"sets priorities for mechanisms" split_words:"true"` + MechanismPriority []string `default:"" desc:"sets priorities for mechanisms" split_words:"true"` } // Process reads config from env diff --git a/internal/xconnectns/options.go b/internal/xconnectns/options.go index b3dc4f3b..a990fc70 100644 --- a/internal/xconnectns/options.go +++ b/internal/xconnectns/options.go @@ -37,7 +37,7 @@ type xconnOptions struct { clientURL *url.URL dialTimeout time.Duration domain2Device map[string]string - prioriyMechanismList []string + mechanismPrioriyList []string statsOpts []stats.Option cleanupOpts []cleanup.Option vxlanOpts []vxlan.Option @@ -116,10 +116,10 @@ func WithVxlanOptions(opts ...vxlan.Option) Option { } } -// WithPriorityMechanisms sets prioritymechanisms options -func WithPriorityMechanisms(priorityList []string) Option { +// WithMechanismPriority sets mechanismpriority option +func WithMechanismPriority(priorityList []string) Option { return func(o *xconnOptions) { - o.prioriyMechanismList = priorityList + o.mechanismPrioriyList = priorityList } } diff --git a/internal/xconnectns/server.go b/internal/xconnectns/server.go index 877af317..f707711a 100644 --- a/internal/xconnectns/server.go +++ b/internal/xconnectns/server.go @@ -80,7 +80,7 @@ func NewServer( vppforwarder.WithClientURL(xconnOpts.clientURL), vppforwarder.WithDialTimeout(xconnOpts.dialTimeout), vppforwarder.WithVlanDomain2Device(xconnOpts.domain2Device), - vppforwarder.WithPriorityMechanisms(xconnOpts.prioriyMechanismList), + vppforwarder.WithMechanismPriority(xconnOpts.mechanismPrioriyList), vppforwarder.WithCleanupOptions(xconnOpts.cleanupOpts...), vppforwarder.WithStatsOptions(xconnOpts.statsOpts...), vppforwarder.WithVxlanOptions(xconnOpts.vxlanOpts...), diff --git a/main.go b/main.go index 76afab44..fedbb475 100644 --- a/main.go +++ b/main.go @@ -248,7 +248,7 @@ func main() { xconnectns.WithAuthorizeServer(authorize.NewServer(authorize.WithSpiffeIDConnectionMap(&spiffeIDConnMap))), xconnectns.WithAuthorizeMonitorConnectionsServer(authmonitor.NewMonitorConnectionServer(authmonitor.WithSpiffeIDConnectionMap(&spiffeIDConnMap))), xconnectns.WithVlanDomain2Device(deviceMap), - xconnectns.WithPriorityMechanisms(cfg.PriorityMechanisms), + xconnectns.WithMechanismPriority(cfg.MechanismPriority), xconnectns.WithClientURL(&cfg.ConnectTo), xconnectns.WithDialTimeout(cfg.DialTimeout), xconnectns.WithStatsOptions(statsOpts...),