Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit 8b29f4a

Browse files
committed
cniovs: Add missing error check for ovs-vsctl add-port
Before this change, when attempting to run ovs-vsctl, any errors were swallowed and not returned. Signed-off-by: Benn Linger <[email protected]>
1 parent c649cfa commit 8b29f4a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: cniovs/cniovs/cniovs.go

+4
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,14 @@ func addLocalDeviceVhost(conf *usrsptypes.NetConf, args *skel.CmdArgs, data *ovs
178178
if vhostName, err := createVhostPort(sockDir, sockRef); err == nil {
179179
if vhostPortMac, err := getVhostPortMac(vhostName); err == nil {
180180
data.VhostMac = vhostPortMac
181+
} else {
182+
return err
181183
}
182184

183185
data.Vhostname = vhostName
184186
data.IfMac = generateRandomMacAddress()
187+
} else {
188+
return err
185189
}
186190

187191
return nil

0 commit comments

Comments
 (0)