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

Start transition to libovsdb #319

Merged
merged 38 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
94d4d26
Makefile: Add update-ovsdb
stgraber Dec 14, 2023
cdef3c3
gomod: Add libovsdb
stgraber Dec 18, 2023
c951403
incusd/network/openvswitch: Add OVS and OVN schemas
stgraber Dec 14, 2023
afc32c5
incusd/network/openvswitch: Remove unused functions
stgraber Dec 18, 2023
d2bfba7
incusd/network/openvswitch: Remove useless code
stgraber Dec 18, 2023
fd03aea
incusd/network/openvswitch: Split OVN logic
stgraber Dec 18, 2023
d87d465
incusd/network/openvswitch: Add OVN database types
stgraber Dec 18, 2023
6e6f25a
incusd/network/openvswitch: Add native ovsdb client
stgraber Dec 18, 2023
fd82c99
incusd/network/openvswitch: Simplify logic
stgraber Dec 18, 2023
2251515
golangci: Don't complain about unused receivers
stgraber Dec 18, 2023
7571480
incusd/network/openvswitch: Use pointer receiver for LogicalRouterDelete
stgraber Dec 18, 2023
e67cddf
incusd/network/openvswitch: Port ChassisGroupChassisAdd to ovsdb
stgraber Dec 18, 2023
ee3f282
incusd/server/network: Move ovn to separate package
stgraber Dec 19, 2023
0b9a4cd
Makefile: Update for new OVN package
stgraber Dec 19, 2023
d3f5884
incusd/network/openvswitch: Update for separate ovn package
stgraber Dec 19, 2023
e761dfb
incusd/network/openvswitch: Move TCP flags to ovn package
stgraber Dec 19, 2023
a863460
incusd: Update for network/ovn
stgraber Dec 19, 2023
710ce0e
incusd/network/openvswitch: Rename to ovs
stgraber Dec 19, 2023
74c470f
Makefile: Update for OVS package
stgraber Dec 19, 2023
a6bd774
incusd: Update for OVS package rename
stgraber Dec 19, 2023
c0ed890
incusd: Fix import shadowing
stgraber Dec 19, 2023
a8fda93
tests: Skip lint on OVSDB schemas
stgraber Dec 19, 2023
3efcba5
incusd/network/ovs: Re-organize the package
stgraber Dec 19, 2023
dd2f1f4
incusd/network/ovs: Rename OVS struct to VSwitch
stgraber Dec 19, 2023
4f03fc1
incusd: Update for NewVSwitch
stgraber Dec 19, 2023
d4c6186
incusd/network/ovn: Re-organize the package
stgraber Dec 19, 2023
c2aa6f2
incusd/network/ovn: Add new Southbound client
stgraber Dec 19, 2023
c75283b
incusd/network/ovn: Move GetLogicalRouterPortActiveChassisHostname to SB
stgraber Dec 19, 2023
3b917ec
incusd/network: Update for GetLogicalRouterPortActiveChassisHostname
stgraber Dec 19, 2023
fb633b2
incusd/network/ovn: Replace OVN struct with NB
stgraber Dec 19, 2023
dca81f0
incusd: Update for OVN NB struct
stgraber Dec 19, 2023
30ffa55
incusd/network/ovn: Port PortGroupInfo to OVSDB
stgraber Dec 20, 2023
46400e8
incusd/network/ovn: Port LogicalSwitchPortDynamicIPs to OVSDB
stgraber Dec 20, 2023
b263393
incusd/network/ovs: Add OVSDB client
stgraber Dec 20, 2023
4e38102
incusd: Update for NewVSwitch changes
stgraber Dec 20, 2023
4657e64
incusd/network/ovs: Port BridgeExists to OVSDB
stgraber Dec 20, 2023
200d947
incusd/network/ovs: Port ChassisID to OVSDB
stgraber Dec 20, 2023
72c2cf3
incusd/network/ovs: Port OVNBridgeMappings to OVSDB
stgraber Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ linters-settings:
- "checkPrivateReceivers"
- "disableStutteringCheck"

# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#unused-receiver
- name: unused-receiver

# https://github.com/mgechev/revive/blob/2a1701aadbedfcc175cb92836a51407bec382652/RULES_DESCRIPTIONS.md#import-shadowing
- name: import-shadowing

Expand Down
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ GOPATH ?= $(shell $(GO) env GOPATH)
CGO_LDFLAGS_ALLOW ?= (-Wl,-wrap,pthread_create)|(-Wl,-z,now)
SPHINXENV=doc/.sphinx/venv/bin/activate
SPHINXPIPPATH=doc/.sphinx/venv/bin/pip
OVN_MINVER=23.03.0
OVS_MINVER=2.15.0

ifneq "$(wildcard vendor)" ""
RAFT_PATH=$(CURDIR)/vendor/raft
Expand Down Expand Up @@ -106,6 +108,24 @@ endif
cd test/mini-oidc && $(GO) mod tidy --go=1.20
@echo "Dependencies updated"

.PHONY: update-ovsdb
update-ovsdb:
go install github.com/ovn-org/libovsdb/cmd/modelgen@main

rm -Rf internal/server/network/ovs/schema
mkdir internal/server/network/ovs/schema
curl -s https://raw.githubusercontent.com/openvswitch/ovs/v$(OVS_MINVER)/vswitchd/vswitch.ovsschema -o internal/server/network/ovs/schema/ovs.json
modelgen -o internal/server/network/ovs/schema/ovs internal/server/network/ovs/schema/ovs.json
rm internal/server/network/ovs/schema/*.json

rm -Rf internal/server/network/ovn/schema
mkdir internal/server/network/ovn/schema
curl -s https://raw.githubusercontent.com/ovn-org/ovn/v$(OVN_MINVER)/ovn-nb.ovsschema -o internal/server/network/ovn/schema/ovn-nb.json
curl -s https://raw.githubusercontent.com/ovn-org/ovn/v$(OVN_MINVER)/ovn-sb.ovsschema -o internal/server/network/ovn/schema/ovn-sb.json
modelgen -o internal/server/network/ovn/schema/ovn-nb internal/server/network/ovn/schema/ovn-nb.json
modelgen -o internal/server/network/ovn/schema/ovn-sb internal/server/network/ovn/schema/ovn-sb.json
rm internal/server/network/ovn/schema/*.json

.PHONY: update-protobuf
update-protobuf:
protoc --go_out=. ./internal/migration/migrate.proto
Expand Down
10 changes: 7 additions & 3 deletions cmd/incusd/networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/lxc/incus/internal/server/instance/instancetype"
"github.com/lxc/incus/internal/server/lifecycle"
"github.com/lxc/incus/internal/server/network"
"github.com/lxc/incus/internal/server/network/openvswitch"
"github.com/lxc/incus/internal/server/network/ovs"
"github.com/lxc/incus/internal/server/project"
"github.com/lxc/incus/internal/server/request"
"github.com/lxc/incus/internal/server/resources"
Expand Down Expand Up @@ -865,8 +865,12 @@ func doNetworkGet(s *state.State, r *http.Request, allNodes bool, projectName st
} else if util.PathExists(fmt.Sprintf("/sys/class/net/%s/bonding", apiNet.Name)) {
apiNet.Type = "bond"
} else {
ovs := openvswitch.NewOVS()
exists, _ := ovs.BridgeExists(apiNet.Name)
vswitch, err := ovs.NewVSwitch()
if err != nil {
return api.Network{}, fmt.Errorf("Failed to connect to OVS: %w", err)
}

exists, _ := vswitch.BridgeExists(apiNet.Name)
if exists {
apiNet.Type = "bridge"
} else {
Expand Down
11 changes: 10 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
github.com/flosch/pongo2 v0.0.0-20200913210552-0d938eb266f3
github.com/fvbommel/sortorder v1.1.0
github.com/go-acme/lego/v4 v4.14.2
github.com/go-logr/logr v1.3.0
github.com/google/gopacket v1.1.19
github.com/google/uuid v1.5.0
github.com/gorilla/mux v1.8.1
Expand All @@ -36,6 +37,7 @@ require (
github.com/olekukonko/tablewriter v0.0.5
github.com/openfga/go-sdk v0.3.1-go1.20
github.com/osrg/gobgp/v3 v3.21.0
github.com/ovn-org/libovsdb v0.6.1-0.20230912124059-239822fe891a
github.com/pkg/sftp v1.13.6
github.com/pkg/xattr v0.4.9
github.com/robfig/cron/v3 v3.0.1
Expand All @@ -59,7 +61,11 @@ require (
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cenkalti/hub v1.0.1 // indirect
github.com/cenkalti/rpc2 v0.0.0-20210604223624-c1acbc6ec984 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
Expand All @@ -69,7 +75,6 @@ require (
github.com/eapache/queue v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-jose/go-jose/v3 v3.0.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
Expand All @@ -88,6 +93,7 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mdlayher/socket v0.4.1 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
Expand All @@ -101,6 +107,9 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rs/cors v1.10.1 // indirect
Expand Down
21 changes: 20 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,20 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-proxyproto v0.1.0 h1:TWWcSsjco7o2itn6r25/5AqKBiWmsiuzsUDLT/MTl7k=
github.com/armon/go-proxyproto v0.1.0/go.mod h1:Xj90dce2VKbHzRAeiVQAMBtj4M5oidoXJ8lmgyW21mw=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
github.com/cenk/hub v1.0.1 h1:RBwXNOF4a8KjD8BJ08XqN8KbrqaGiQLDrgvUGJSHuPA=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cenkalti/hub v1.0.1 h1:UMtjc6dHSaOQTO15SVA50MBIR9zQwvsukQupDrkIRtg=
github.com/cenkalti/hub v1.0.1/go.mod h1:tcYwtS3a2d9NO/0xDXVJWx3IedurUjYCqFCmpi0lpHs=
github.com/cenkalti/rpc2 v0.0.0-20210604223624-c1acbc6ec984 h1:CNwZyGS6KpfaOWbh2yLkSy3rSTUh3jub9CzpFpP6PVQ=
github.com/cenkalti/rpc2 v0.0.0-20210604223624-c1acbc6ec984/go.mod h1:v2npkhrXyk5BCnkNIiPdRI23Uq6uWPUQGL2hnRcRr/M=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/checkpoint-restore/go-criu/v6 v6.3.0 h1:mIdrSO2cPNWQY1truPg6uHLXyKHk3Z5Odx4wjKOASzA=
github.com/checkpoint-restore/go-criu/v6 v6.3.0/go.mod h1:rrRTN/uSwY2X+BPRl/gkulo9gsKOSAeVp9/K2tv7xZI=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
Expand Down Expand Up @@ -297,6 +306,8 @@ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh
github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI=
github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/mdlayher/ndp v1.0.1 h1:+yAD79/BWyFlvAoeG5ncPS0ItlHP/eVbH7bQ6/+LVA4=
github.com/mdlayher/ndp v1.0.1/go.mod h1:rf3wKaWhAYJEXFKpgF8kQ2AxypxVbfNcZbqoAo6fVzk=
github.com/mdlayher/netx v0.0.0-20230430222610-7e21880baee8 h1:HMgSn3c16SXca3M+n6fLK2hXJLd4mhKAsZZh7lQfYmQ=
Expand Down Expand Up @@ -346,6 +357,8 @@ github.com/openfga/go-sdk v0.3.1-go1.20 h1:mH0nczUUEl4dTMTC5WY09o+1sgPcwyL7m4jVu
github.com/openfga/go-sdk v0.3.1-go1.20/go.mod h1:W4SNYMSxptGOtA9aGYxsYUmSC7LaZYP7y9qbT36ouCc=
github.com/osrg/gobgp/v3 v3.21.0 h1:OCjDIz2duA36tLoQElm8S2ZfxClPqcM9B4SfIlfYQTI=
github.com/osrg/gobgp/v3 v3.21.0/go.mod h1:4fbscYpsCk14EO16nTWAdJyErO4MbAZ2zLJmsmeXu/k=
github.com/ovn-org/libovsdb v0.6.1-0.20230912124059-239822fe891a h1:6bv0BvHLB4Ustw/rwk2ErCuldlS9gFiuwgPvFVEdvQg=
github.com/ovn-org/libovsdb v0.6.1-0.20230912124059-239822fe891a/go.mod h1:LC5DOvcY58jOG3HTvDyCVidoMJDurPeu+xlxv5Krd9Q=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI=
Expand All @@ -369,7 +382,13 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b h1:0LFwY6Q3gMACTjAbMZBjXAqTOzOwFaj2Ld6cjeQ7Rig=
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY=
github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
Expand All @@ -379,7 +398,7 @@ github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo=
github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
Expand Down
11 changes: 7 additions & 4 deletions internal/server/device/nic_bridged.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/lxc/incus/internal/server/instance/instancetype"
"github.com/lxc/incus/internal/server/ip"
"github.com/lxc/incus/internal/server/network"
"github.com/lxc/incus/internal/server/network/openvswitch"
"github.com/lxc/incus/internal/server/network/ovs"
"github.com/lxc/incus/internal/server/resources"
localUtil "github.com/lxc/incus/internal/server/util"
internalUtil "github.com/lxc/incus/internal/util"
Expand Down Expand Up @@ -1529,7 +1529,10 @@ func (d *nicBridged) setupNativeBridgePortVLANs(hostName string) error {

// setupOVSBridgePortVLANs configures the bridge port with the specified VLAN settings on the openvswitch bridge.
func (d *nicBridged) setupOVSBridgePortVLANs(hostName string) error {
ovs := openvswitch.NewOVS()
vswitch, err := ovs.NewVSwitch()
if err != nil {
return fmt.Errorf("Failed to connect to OVS: %w", err)
}

// Set port on bridge to specified untagged PVID.
if d.config["vlan"] != "" {
Expand All @@ -1542,7 +1545,7 @@ func (d *nicBridged) setupOVSBridgePortVLANs(hostName string) error {
// Order is important here, as vlan_mode is set to "access", assuming that vlan.tagged is not used.
// If vlan.tagged is specified, then we expect it to also change the vlan_mode as needed.
if d.config["vlan"] != "none" {
err := ovs.BridgePortSet(hostName, "vlan_mode=access", fmt.Sprintf("tag=%s", d.config["vlan"]))
err := vswitch.BridgePortSet(hostName, "vlan_mode=access", fmt.Sprintf("tag=%s", d.config["vlan"]))
if err != nil {
return err
}
Expand Down Expand Up @@ -1572,7 +1575,7 @@ func (d *nicBridged) setupOVSBridgePortVLANs(hostName string) error {
// Also set the vlan_mode as needed from above.
// Must come after the PortSet command used for setting "vlan" mode above so that the correct
// vlan_mode is retained.
err = ovs.BridgePortSet(hostName, fmt.Sprintf("vlan_mode=%s", vlanMode), fmt.Sprintf("trunks=%s", strings.Join(vlanIDs, ",")))
err = vswitch.BridgePortSet(hostName, fmt.Sprintf("vlan_mode=%s", vlanMode), fmt.Sprintf("trunks=%s", strings.Join(vlanIDs, ",")))
if err != nil {
return err
}
Expand Down
Loading
Loading