Skip to content

Commit

Permalink
ip: include peer name in error message
Browse files Browse the repository at this point in the history
If makeVeth fails as a peer exists, the existing peer name should be
included in the error message.

Signed-off-by: Samuel Karp <[email protected]>
  • Loading branch information
samuelkarp committed Apr 26, 2024
1 parent 670139c commit 44814e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ip/link_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func makeVeth(name, vethPeerName string, mtu int, mac string, hostNS ns.NetNS) (
if peerExists(peerName) && vethPeerName == "" {
continue
}
return peerName, veth, fmt.Errorf("container veth name provided (%v) already exists", name)
return peerName, veth, fmt.Errorf("container veth name (%v) peer provided (%v) already exists", name, peerName)
default:
return peerName, veth, fmt.Errorf("failed to make veth pair: %v", err)
}
Expand Down

0 comments on commit 44814e7

Please sign in to comment.