diff --git a/src/middlewared/middlewared/alert/source/datasets.py b/src/middlewared/middlewared/alert/source/datasets.py index 0906e4cf6b2a4..3f2f864f38599 100644 --- a/src/middlewared/middlewared/alert/source/datasets.py +++ b/src/middlewared/middlewared/alert/source/datasets.py @@ -22,9 +22,11 @@ async def check(self): unencrypted_datasets = [] for dataset in await self.middleware.call('pool.dataset.query', [['encrypted', '=', True]]): for child in dataset['children']: - if child['name'] == f'{child["pool"]}/ix-applications' or child['name'].startswith( - f'{child["pool"]}/ix-applications/' - ): + if child['name'] in ( + f'{child["pool"]}/ix-applications', f'{child["pool"]}/ix-apps' + ) or child['name'].startswith(( + f'{child["pool"]}/ix-applications/', f'{child["pool"]}/ix-apps/' + )): continue if not child['encrypted']: diff --git a/src/middlewared/middlewared/plugins/catalog/apps_details.py b/src/middlewared/middlewared/plugins/catalog/apps_details.py index b0e4ced9cb8c9..d126029bc9e3f 100644 --- a/src/middlewared/middlewared/plugins/catalog/apps_details.py +++ b/src/middlewared/middlewared/plugins/catalog/apps_details.py @@ -63,7 +63,7 @@ def cached(self, label): 'name': 'chia', 'categories': ['storage', 'crypto'], 'app_readme': 'app readme here', - 'location': '/mnt/evo/ix-applications/catalogs/github_com_truenas_charts_git_master/charts/chia', + 'location': '/mnt/evo/ix-apps/catalogs/github_com_truenas_charts_git_master/charts/chia', 'healthy': True, 'healthy_error': None, 'latest_version': '1.2.0', diff --git a/src/middlewared/middlewared/plugins/cloud_sync.py b/src/middlewared/middlewared/plugins/cloud_sync.py index 4ae9b874ea41c..acb98edd9d597 100644 --- a/src/middlewared/middlewared/plugins/cloud_sync.py +++ b/src/middlewared/middlewared/plugins/cloud_sync.py @@ -105,8 +105,12 @@ async def __aenter__(self): if self.cloud_sync.get("path"): if os.path.dirname(self.cloud_sync.get("path").rstrip("/")) == "/mnt": - rclone_filter.append("- /ix-applications") - rclone_filter.append("- /ix-applications/**") + rclone_filter.extend([ + "- /ix-applications", + "- /ix-apps", + "- /ix-applications/**", + "- /ix-apps/**", + ]) for item in self.cloud_sync.get("exclude") or []: rclone_filter.append(f"- {item}") diff --git a/src/middlewared/middlewared/plugins/filesystem.py b/src/middlewared/middlewared/plugins/filesystem.py index bb29ceec741fb..79ee19ed5969b 100644 --- a/src/middlewared/middlewared/plugins/filesystem.py +++ b/src/middlewared/middlewared/plugins/filesystem.py @@ -273,9 +273,9 @@ def listdir(self, path, filters, options): if not path.is_dir(): raise CallError(f'Path {path} is not a directory', errno.ENOTDIR) - # TODO: once new apps implementation is in-place remove this check - if 'ix-applications' in path.parts: - raise CallError('Ix-applications is a system managed dataset and its contents cannot be listed') + for ds in ('ix-applications', 'ix-apps'): + if ds in path.parts: + raise CallError(f'{ds!r} is a system managed dataset and its contents cannot be listed') file_type = None for filter_ in filters: diff --git a/src/middlewared/middlewared/plugins/pool_/dataset.py b/src/middlewared/middlewared/plugins/pool_/dataset.py index f1d519faf6dae..5dc8a0ac1ace8 100644 --- a/src/middlewared/middlewared/plugins/pool_/dataset.py +++ b/src/middlewared/middlewared/plugins/pool_/dataset.py @@ -166,6 +166,7 @@ async def internal_datasets_filters(self): ['pool', '!=', await self.middleware.call('boot.pool_name')], ['id', 'rnin', '/.system'], ['id', 'rnin', '/ix-applications/'], + ['id', 'rnin', '/ix-apps/'], ] @private diff --git a/src/middlewared/middlewared/plugins/pool_/export.py b/src/middlewared/middlewared/plugins/pool_/export.py index f694c371459b7..7ee25f76230e8 100644 --- a/src/middlewared/middlewared/plugins/pool_/export.py +++ b/src/middlewared/middlewared/plugins/pool_/export.py @@ -17,7 +17,7 @@ class Config: def cleanup_after_export(self, poolinfo, opts): try: if all((opts['destroy'], opts['cascade'])) and (contents := os.listdir(poolinfo['path'])): - if len(contents) == 1 and contents[0] == 'ix-applications': + if len(contents) == 1 and contents[0] in ('ix-applications', 'ix-apps'): # This means: # 1. zpool was destroyed (disks were wiped) # 2. end-user chose to delete all share configuration associated diff --git a/src/middlewared/middlewared/plugins/pool_/import_pool.py b/src/middlewared/middlewared/plugins/pool_/import_pool.py index a329d27a46e84..13e4243a4d414 100644 --- a/src/middlewared/middlewared/plugins/pool_/import_pool.py +++ b/src/middlewared/middlewared/plugins/pool_/import_pool.py @@ -129,9 +129,10 @@ async def import_pool(self, job, data): # Recursively reset dataset mountpoints for the zpool. recursive = True for child in await self.middleware.call('zfs.dataset.child_dataset_names', pool_name): - if child == os.path.join(pool_name, 'ix-applications'): + if child in (os.path.join(pool_name, k) for k in ('ix-applications', 'ix-apps')): # 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 continue try: # Reset all mountpoints diff --git a/src/middlewared/middlewared/validators.py b/src/middlewared/middlewared/validators.py index d4c1ee04eb911..2b3590aadf184 100644 --- a/src/middlewared/middlewared/validators.py +++ b/src/middlewared/middlewared/validators.py @@ -400,7 +400,7 @@ def check_path_resides_within_volume_sync(verrors, schema_name, path, vol_names) * path is within /mnt * path is located within one of the specified `vol_names` * path is not explicitly a `.zfs` or `.zfs/snapshot` directory - * path is not ix-applications dataset + * path is not ix-applications /ix-apps dataset """ if path_location(path).name == 'EXTERNAL': # There are some fields where we allow external paths @@ -428,7 +428,7 @@ def check_path_resides_within_volume_sync(verrors, schema_name, path, vol_names) "be accessed through the path-based API, then it should be called " "directly, e.g. '/mnt/dozer/.zfs/snapshot/mysnap'.") - for check_path, svc_name in (('ix-applications', 'Applications'),): + for check_path, svc_name in (('ix-applications', 'Applications'), ('ix-apps', 'Applications'),): in_use = False if is_mountpoint and rp.name == check_path: in_use = True