Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-131704 / 25.04 / Make sure docker datasets are mounted if address pools are changed only #14654

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/middlewared/middlewared/plugins/docker/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ async def do_update(self, job, data):
await self.middleware.call('docker.setup.status_change')
elif config['pool'] and config['address_pools'] != old_config['address_pools']:
job.set_progress(60, 'Starting docker')
catalog_sync_job = await self.middleware.call('docker.fs_manage.mount')
if catalog_sync_job:
await catalog_sync_job.wait()

await self.middleware.call('service.start', 'docker')

if not old_config['nvidia'] and config['nvidia']:
Expand Down
12 changes: 11 additions & 1 deletion tests/api2/test_docker_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ def test_apps_are_running():
assert call('docker.status')['status'] == 'RUNNING'


@pytest.mark.dependency(depends=['docker_setup'])
def test_apps_dataset_after_address_pool_update():
docker_config = call('docker.update', {'address_pools': [{'base': '172.17.0.0/12', 'size': 27}]}, job=True)
assert docker_config['address_pools'] == [{'base': '172.17.0.0/12', 'size': 27}]
assert call('filesystem.statfs', IX_APPS_MOUNT_PATH)['source'] == docker_config['dataset']
assert call('docker.status')['status'] == 'RUNNING'


def test_unset_docker_pool(docker_pool):
docker_config = call('docker.update', {'pool': None}, job=True)
docker_config = call(
'docker.update', {'pool': None, 'address_pools': [{'base': '172.17.0.0/12', 'size': 24}]}, job=True
)
assert docker_config['pool'] is None, docker_config
Loading