mirror of
https://github.com/moby/moby.git
synced 2026-01-12 03:01:38 +00:00
Partially revert commit94b880f. The CheckDuplicate field has been introduced in commit2ab94e1. At that time, this check was done in the network router. It was then moved to the daemon package in commit3ca2982. However, commit94b880fduplicated the logic into the network router for no apparent reason. Finally, commitab18718made sure a 409 would be returned instead of a 500. As this logic is first done by the daemon, the error -> warning conversion can't happen because CheckDuplicate has to be true for the daemon package to return an error. If it's false, the daemon proceed with the network creation, set the Warning field of its return value and return no error. Thus, the CheckDuplicate logic in the api is removed and libnetwork.NetworkNameError now implements the ErrConflict interface. Signed-off-by: Albin Kerouanton <albinker@gmail.com>