@@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
13
13
limitations under the License.
14
14
*/
15
15
16
- package drivers
16
+ package ovsd
17
17
18
18
import (
19
19
"encoding/json"
@@ -26,6 +26,7 @@ import (
26
26
27
27
log "github.com/Sirupsen/logrus"
28
28
"github.com/contiv/netplugin/core"
29
+ "github.com/contiv/netplugin/drivers"
29
30
"github.com/contiv/netplugin/netmaster/mastercfg"
30
31
"github.com/contiv/netplugin/netplugin/nameserver"
31
32
"github.com/contiv/netplugin/utils/netutils"
@@ -220,7 +221,7 @@ func (d *OvsDriver) Init(info *core.InstanceInfo) error {
220
221
func (d * OvsDriver ) DeleteHostAccPort (id string ) error {
221
222
sw , found := d .switchDb ["host" ]
222
223
if found {
223
- operEp := & OvsOperEndpointState {}
224
+ operEp := & drivers. OperEndpointState {}
224
225
operEp .StateDriver = d .oper .StateDriver
225
226
err := operEp .Read (id )
226
227
if err != nil {
@@ -293,7 +294,7 @@ func (d *OvsDriver) CreateNetwork(id string) error {
293
294
}
294
295
295
296
// DeleteNetwork deletes a network by named identifier
296
- func (d * OvsDriver ) DeleteNetwork (id , nwType , encap string , pktTag , extPktTag int , gateway string , tenant string ) error {
297
+ func (d * OvsDriver ) DeleteNetwork (id , subnet , nwType , encap string , pktTag , extPktTag int , gateway string , tenant string ) error {
297
298
log .Infof ("delete net %s, nwType %s, encap %s, tags: %d/%d" , id , nwType , encap , pktTag , extPktTag )
298
299
299
300
// Find the switch based on network type
@@ -309,7 +310,7 @@ func (d *OvsDriver) DeleteNetwork(id, nwType, encap string, pktTag, extPktTag in
309
310
hostName , _ := os .Hostname ()
310
311
epID := id + "-" + hostName
311
312
312
- epOper := OvsOperEndpointState {}
313
+ epOper := drivers. OperEndpointState {}
313
314
epOper .StateDriver = d .oper .StateDriver
314
315
err := epOper .Read (epID )
315
316
if err == nil {
@@ -386,7 +387,7 @@ func (d *OvsDriver) CreateEndpoint(id string) error {
386
387
// Skip Veth pair creation for infra nw endpoints
387
388
skipVethPair := (cfgNw .NwType == "infra" )
388
389
389
- operEp := & OvsOperEndpointState {}
390
+ operEp := & drivers. OperEndpointState {}
390
391
operEp .StateDriver = d .oper .StateDriver
391
392
err = operEp .Read (id )
392
393
if core .ErrIfKeyExists (err ) != nil {
@@ -445,7 +446,7 @@ func (d *OvsDriver) CreateEndpoint(id string) error {
445
446
return err
446
447
}
447
448
// Save the oper state
448
- operEp = & OvsOperEndpointState {
449
+ operEp = & drivers. OperEndpointState {
449
450
NetID : cfgEp .NetID ,
450
451
EndpointID : cfgEp .EndpointID ,
451
452
ServiceName : cfgEp .ServiceName ,
@@ -517,7 +518,7 @@ func (d *OvsDriver) UpdateEndpointGroup(id string) error {
517
518
518
519
// DeleteEndpoint deletes an endpoint by named identifier.
519
520
func (d * OvsDriver ) DeleteEndpoint (id string ) error {
520
- epOper := OvsOperEndpointState {}
521
+ epOper := drivers. OperEndpointState {}
521
522
epOper .StateDriver = d .oper .StateDriver
522
523
err := epOper .Read (id )
523
524
if err != nil {
@@ -552,6 +553,10 @@ func (d *OvsDriver) DeleteEndpoint(id string) error {
552
553
d .oper .localEpInfoMutex .Lock ()
553
554
delete (d .oper .LocalEpInfo , id )
554
555
d .oper .localEpInfoMutex .Unlock ()
556
+ err = d .oper .Write ()
557
+ if err != nil {
558
+ return err
559
+ }
555
560
556
561
return nil
557
562
}
0 commit comments