netsetgo icon indicating copy to clipboard operation
netsetgo copied to clipboard

netsetgo cannot recreate default route

Open marcosps opened this issue 6 years ago • 2 comments

If we run netsetgo into an existing container with a default route already set, the error below is returned:

ERROR - file exists

and exit code is 1. But if we remove the default route from inside the container, netsetgo runs without any message, returning 0 as exit code. The code in question calls netlink.RouteAdd: https://github.com/teddyking/netsetgo/blob/master/configurer/container.go#L47

In this case, should netsetgo recreate the default route, or just let it be without error if a default route already exists?

Thanks!

marcosps avatar Jun 05 '18 02:06 marcosps

The intention for netsetgo is that it only gets run once when a container is first created, at which point there should be no default route, so I think it's ok to just let it error out if a route does already exist.

teddyking avatar Jun 09 '18 07:06 teddyking

Fair enough, but I will try to add a more meaningful message :)

marcosps avatar Jun 11 '18 16:06 marcosps

Ok, lets close this old bug :)

marcosps avatar Jun 19 '23 01:06 marcosps