Skip to content

Commit

Permalink
Flush ip before setting ip
Browse files Browse the repository at this point in the history
  • Loading branch information
bn222 committed Jan 15, 2025
1 parent f8c46d8 commit 1e172dc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ipu-plugin/pkg/ipuplugin/ovsbridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ func (b *ovsBridge) EnsureBridgeExists() error {
log.Errorf("EnsureBridgeExists: error->%v from getInfrapodNamespace", err)
return err
}
// Flush any existing IP addresses from the bridge interface from any previous runs
flushIPCmd := []string{"net", "exec", netNs, "ip", "addr", "flush", "dev", b.bridgeName}
if err := utils.ExecOsCommand("ip", flushIPCmd...); err != nil {
return fmt.Errorf("error flushing IP addresses for bridge %s: %v", b.bridgeName, err)
}
//assigning IP for bridge interface.
ipAddr := ACC_VM_PR_IP
cmdParams := []string{"net", "exec", netNs, "ip", "addr", "add", "dev", b.bridgeName, ipAddr}
Expand Down

0 comments on commit 1e172dc

Please sign in to comment.