Skip to content

Commit

Permalink
vpcagent: work around nics of pending deleted guest
Browse files Browse the repository at this point in the history
  • Loading branch information
yousong committed Apr 27, 2020
1 parent 5fdf202 commit 1183588
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/vpcagent/models/modelset.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,19 @@ func (set Guestnetworks) Copy() apihelper.IModelSet {
}

func (set Guestnetworks) joinGuests(subEntries Guests) bool {
correct := true
for _, gn := range set {
gId := gn.GuestId
g, ok := subEntries[gId]
if !ok {
if gn.Network != nil && gn.Network.Vpc != nil {
log.Warningf("guestnetwork %d(net:%s,ip:%s) guest id %s not found",
gn.RowId, gn.NetworkId, gn.IpAddr, gId)
correct = false
// Only log info instead of error because the
// guest could be in pending_deleted state
log.Infof("guestnetwork (net:%s,ip:%s) guest id %s not found",
gn.NetworkId, gn.IpAddr, gId)
}
continue
}
gn.Guest = g
}
return correct
return true
}
3 changes: 3 additions & 0 deletions pkg/vpcagent/ovn/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ func (w *Worker) run(ctx context.Context, mss *agentmodels.ModelSets) (err error
for _, network := range vpc.Networks {
ovndb.ClaimNetwork(ctx, network)
for _, guestnetwork := range network.Guestnetworks {
if guestnetwork.Guest == nil {
continue
}
var (
guest = guestnetwork.Guest
network = guestnetwork.Network
Expand Down

0 comments on commit 1183588

Please sign in to comment.