From aeaf29bda74a8434d8304365babfbcbc9d8ea79f Mon Sep 17 00:00:00 2001 From: sareti Date: Sat, 26 Aug 2017 22:03:43 -0400 Subject: [PATCH] Fixing the issue where libnetwork deletes vrs vports that are not managed by plugin --- client/vrsclient.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/vrsclient.go b/client/vrsclient.go index c30d8d8..f96cbfb 100644 --- a/client/vrsclient.go +++ b/client/vrsclient.go @@ -319,11 +319,13 @@ func (nvrsc *NuageVRSClient) auditOVSDB() error { } for _, portName := range portNames { - containerInfo[nuageConfig.BridgePortKey] = portName - containerInfo[nuageConfig.UUIDKey] = entity - err := nvrsc.deleteEntries(containerInfo) - if err != nil { - log.Errorf("Deleting entries in audit failed with error %v", err) + if strings.HasPrefix(portName, nuageConfig.BasePrefix) { //manage ports with only libnetwork prefix + containerInfo[nuageConfig.BridgePortKey] = portName + containerInfo[nuageConfig.UUIDKey] = entity + err := nvrsc.deleteEntries(containerInfo) + if err != nil { + log.Errorf("Deleting entries in audit failed with error %v", err) + } } } }