Skip to content

Commit

Permalink
Wait for default interface to come up before trying to start docker
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicaj committed Sep 5, 2024
1 parent 0f6aae8 commit 63620a7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/middlewared/middlewared/plugins/docker/state_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from datetime import datetime

from middlewared.service import CallError, private, Service
from middlewared.utils.interface import wait_for_default_interface_link_state_up

from .state_utils import (
DatasetDefaults, DOCKER_DATASET_NAME, docker_datasets, IX_APPS_MOUNT_PATH, IX_APPS_DIR_NAME,
missing_required_datasets,
DatasetDefaults, DOCKER_DATASET_NAME, docker_datasets, IX_APPS_MOUNT_PATH, missing_required_datasets,
)


Expand Down Expand Up @@ -52,10 +52,15 @@ async def validate_fs(self):

# What we want to validate now is that the interface on default route is up and running
# This is problematic for bridge interfaces which can or cannot come up in time
await self.validate_interfaces()

@private
async def validate_interfaces(self):
pass
default_iface, success = wait_for_default_interface_link_state_up()
if default_iface is None:
raise CallError('Unable to determine default interface.')
elif not success:
raise CallError(f'Default interface {default_iface!r} is not in active state')

@private
async def status_change(self):
Expand Down

0 comments on commit 63620a7

Please sign in to comment.