Skip to content

Commit 000d200

Browse files
committed
Avoid early DNS plug-in start
A connectivity check can potentially be triggered before the DNS plug-in is loaded. Avoid calling restart on the DNS plug-in before it got initiially loaded. This prevents starting before attaching. The attaching makes sure that the DNS plug-in container is recreated before the DNS plug-in is initially started, which is e.g. needed by a potentially hassio network configuration change (e.g. the migration required to enable/disable IPv6 on the hassio network, see #5879).
1 parent 7f54383 commit 000d200

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

supervisor/host/network.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ async def _check_connectivity_changed(
158158
DBUS_ATTR_PRIMARY_CONNECTION in changed
159159
and changed[DBUS_ATTR_PRIMARY_CONNECTION]
160160
and changed[DBUS_ATTR_PRIMARY_CONNECTION] != DBUS_OBJECT_BASE
161+
and await self.sys_plugins.dns.is_running()
161162
):
162163
await self.sys_plugins.dns.restart()
163164

supervisor/plugins/dns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ async def restart(self) -> None:
211211
try:
212212
await self.instance.restart()
213213
except DockerError as err:
214-
raise CoreDNSError("Can't start CoreDNS plugin", _LOGGER.error) from err
214+
raise CoreDNSError("Can't restart CoreDNS plugin", _LOGGER.error) from err
215215

216216
async def start(self) -> None:
217217
"""Run CoreDNS."""

0 commit comments

Comments
 (0)