Skip to content

Commit

Permalink
skip ping gateway for pods during live migration
Browse files Browse the repository at this point in the history
(cherry picked from commit 1264684)
  • Loading branch information
chestack authored and oilbeater committed Mar 3, 2022
1 parent 092db78 commit 0006902
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/daemon/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,14 @@ func (csh cniServerHandler) handleAdd(req *restful.Request, resp *restful.Respon
return
}

if !podSubnet.Spec.DisableGatewayCheck {
if podSubnet.Spec.Vlan != "" && !podSubnet.Spec.LogicalGateway {
gatewayCheckMode = gatewayCheckModeArping
} else {
gatewayCheckMode = gatewayCheckModePing
//skip ping check gateway for pods during live migration
if pod.Annotations[fmt.Sprintf(util.LiveMigrationAnnotationTemplate, podRequest.Provider)] != "true" {
if !podSubnet.Spec.DisableGatewayCheck {
if podSubnet.Spec.Vlan != "" && !podSubnet.Spec.LogicalGateway {
gatewayCheckMode = gatewayCheckModeArping
} else {
gatewayCheckMode = gatewayCheckModePing
}
}
}

Expand Down

0 comments on commit 0006902

Please sign in to comment.