Skip to content

Commit

Permalink
Make sure ix-apps mountpoint is correct (#14937)
Browse files Browse the repository at this point in the history
If a user downgrades to DF or earlier and he had ix-apps dataset, and he comes back to EE or later, what will happen is that the mountpoint for ix-apps would be reset because of the logic we have in place to reset any custom mountpoints any user might have. So changes have been added to ensure that ix-apps dataset always has a consistent mountpoint set because then EE or later can treat it as apps dataset (if apps are configured) which will result in various errors as it would not be mounted where we want it to be mounted
  • Loading branch information
sonicaj authored Nov 19, 2024
1 parent 87ca663 commit a0ba32d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/middlewared/middlewared/plugins/pool_/import_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import subprocess

from middlewared.plugins.docker.state_utils import IX_APPS_DIR_NAME
from middlewared.schema import accepts, Bool, Dict, List, returns, Str
from middlewared.service import CallError, InstanceNotFound, job, private, Service

Expand Down Expand Up @@ -133,6 +134,13 @@ async def import_pool(self, job, data):
# We exclude `ix-applications` dataset since resetting it will
# cause PVC's to not mount because "mountpoint=legacy" is expected.
# We exclude `ix-apps` dataset since it has a custom mountpoint in place
# If user downgrades to DF or earlier and he had ix-apps dataset, and he comes back
# to EE or later, what will happen is that the mountpoint for ix-apps would be reset
# because of the logic we have below, hence we just set and it's children will inherit it
if child == os.path.join(pool_name, 'ix-apps'):
await self.middleware.call(
'zfs.dataset.update', child, {'properties': {'mountpoint': {'value': f'/{IX_APPS_DIR_NAME}'}}}
)
continue
try:
# Reset all mountpoints
Expand Down

0 comments on commit a0ba32d

Please sign in to comment.