@@ -158,13 +158,13 @@ func (ovsd *OvsDriver) ovsdbTransact(ops []ovsdb.Operation) ([]ovsdb.OperationRe
158
158
// **************** OVS driver API ********************
159
159
160
160
// CreatePort Create an internal port in OVS
161
- func (ovsd * OvsBridgeDriver ) CreatePort (intfName , contNetnsPath , contIfaceName , ovnPortName string , ofportRequest uint , vlanTag uint , trunks []uint , portType string , intfType string ) error {
161
+ func (ovsd * OvsBridgeDriver ) CreatePort (intfName , contNetnsPath , contIfaceName , ovnPortName string , ofportRequest uint , vlanTag uint , trunks []uint , portType string , intfType string , contPodUid string ) error {
162
162
intfUUID , intfOp , err := createInterfaceOperation (intfName , ofportRequest , ovnPortName , intfType )
163
163
if err != nil {
164
164
return err
165
165
}
166
166
167
- portUUID , portOp , err := createPortOperation (intfName , contNetnsPath , contIfaceName , vlanTag , trunks , portType , intfUUID )
167
+ portUUID , portOp , err := createPortOperation (intfName , contNetnsPath , contIfaceName , vlanTag , trunks , portType , intfUUID , contPodUid )
168
168
if err != nil {
169
169
return err
170
170
}
@@ -658,7 +658,7 @@ func (ovsd *OvsDriver) GetOvsPortForContIface(contIface, contNetnsPath string) (
658
658
return "" , false , err
659
659
}
660
660
661
- condition := ovsdb .NewCondition ("external_ids" , ovsdb .ConditionEqual , ovsmap )
661
+ condition := ovsdb .NewCondition ("external_ids" , ovsdb .ConditionIncludes , ovsmap )
662
662
colums := []string {"name" , "external_ids" }
663
663
port , err := ovsd .findByCondition ("Port" , condition , colums )
664
664
if err != nil {
@@ -853,7 +853,7 @@ func createInterfaceOperation(intfName string, ofportRequest uint, ovnPortName s
853
853
return intfUUID , & intfOp , nil
854
854
}
855
855
856
- func createPortOperation (intfName , contNetnsPath , contIfaceName string , vlanTag uint , trunks []uint , portType string , intfUUID ovsdb.UUID ) (ovsdb.UUID , * ovsdb.Operation , error ) {
856
+ func createPortOperation (intfName , contNetnsPath , contIfaceName string , vlanTag uint , trunks []uint , portType string , intfUUID ovsdb.UUID , contPodUid string ) (ovsdb.UUID , * ovsdb.Operation , error ) {
857
857
portUUIDStr := intfName
858
858
portUUID := ovsdb.UUID {GoUUID : portUUIDStr }
859
859
@@ -877,9 +877,10 @@ func createPortOperation(intfName, contNetnsPath, contIfaceName string, vlanTag
877
877
}
878
878
879
879
oMap , err := ovsdb .NewOvsMap (map [string ]string {
880
- "contNetns" : contNetnsPath ,
881
- "contIface" : contIfaceName ,
882
- "owner" : ovsPortOwner ,
880
+ "contPodUid" : contPodUid ,
881
+ "contNetns" : contNetnsPath ,
882
+ "contIface" : contIfaceName ,
883
+ "owner" : ovsPortOwner ,
883
884
})
884
885
if err != nil {
885
886
return ovsdb.UUID {}, nil , err
0 commit comments