You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if cmdAdd function fails, we rely on top level err error variable to determine if cleanup needs to occur via defer statements [1]
This is brittle as err variable may be re-declared in inner-scope masking it and in case of error in inner scope causing the deferred functions to behave in an un-desirable manner (essentially do nothing)
we should come up with a better mechanism for cleanup. it might not look pretty but it should be more robust.
Currently if
cmdAdd
function fails, we rely on top levelerr
error variable to determine if cleanup needs to occur viadefer
statements [1]This is brittle as
err
variable may be re-declared in inner-scope masking it and in case of error in inner scope causing the deferred functions to behave in an un-desirable manner (essentially do nothing)we should come up with a better mechanism for cleanup. it might not look pretty but it should be more robust.
[1]
sriov-cni/cmd/sriov/main.go
Line 113 in 2aea1bb
The text was updated successfully, but these errors were encountered: