comitup icon indicating copy to clipboard operation
comitup copied to clipboard

Filter docker devices to add_hosts()

Open sebastianeferrer opened this issue 3 years ago • 5 comments

I have a conflict between docker and comitup. First approach was to implement comitup callback depending on connection state to stop the docker container that was bodering. Then I found that I needed my docker container running without interruption in case wifi fails so I was trying to figure out what is the function that makes comitup have a conflict with the docker interfaces.

Digging a bit inside the logs in debug mode I found out add_hosts() function trying to add this unwanted docker interfaces.

def add_hosts(hosts: List[str]) -> None:
    establish_group()
    int_mapping = get_interface_mapping()

    devices: Optional[List["NetworkManager.Device"]] = nm.get_devices()

I think that may be replacion nm.get_devices() with nm.get_wifi_devices(), the issue will be solver. Am I in the wrong way or is this correct way?

I really appreciate all the hard work you have done for this proyect and I thank to you!

sebastianeferrer avatar Feb 09 '22 19:02 sebastianeferrer

If the issue involves networking, I suspect the solution follows along the lines of this.

davesteele avatar Feb 09 '22 21:02 davesteele

Sorry Dave, I'd posted this issue by mistake, but now I'm editing first comment to explain what it came about. It's about conflict between docker and comitup.

sebastianeferrer avatar Feb 15 '22 02:02 sebastianeferrer

Good work.

The add_hosts() function is getting a list of network devices for publishing ZeroConf services and mdns records - it needs to list both wired and wireless devices. I can believe that it could have some heartache with devices created by Docker.

I suspect a new function (get_network_endpoints()?) that filters a la get_wifi_devices() to provide a list of "useful" devices.

davesteele avatar Feb 16 '22 19:02 davesteele

Note that Comitup also takes action on loss of a wifi connection.

davesteele avatar Feb 16 '22 19:02 davesteele

I will try to play with this that you pointed out and I will back with the results. Thanks again for the fast reponse! You are the best!

sebastianeferrer avatar Feb 18 '22 14:02 sebastianeferrer