From 7804445280eee436c505846f2bbea433c9018bcc Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Fri, 3 May 2024 14:21:55 +0300 Subject: [PATCH] nextcloud: fix migration (#2434) --- library/ix-dev/charts/nextcloud/Chart.yaml | 2 +- library/ix-dev/charts/nextcloud/migrations/migrate | 7 ++++++- library/ix-dev/charts/nextcloud/questions.yaml | 7 +++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/library/ix-dev/charts/nextcloud/Chart.yaml b/library/ix-dev/charts/nextcloud/Chart.yaml index 9a7af2ffcd..836b1fbb4b 100644 --- a/library/ix-dev/charts/nextcloud/Chart.yaml +++ b/library/ix-dev/charts/nextcloud/Chart.yaml @@ -4,7 +4,7 @@ description: A file sharing server that puts the control and security of your ow annotations: title: Nextcloud type: application -version: 2.0.1 +version: 2.0.2 apiVersion: v2 appVersion: 29.0.0 kubeVersion: '>=1.16.0-0' diff --git a/library/ix-dev/charts/nextcloud/migrations/migrate b/library/ix-dev/charts/nextcloud/migrations/migrate index db4fd9cfb9..135e93b9b6 100755 --- a/library/ix-dev/charts/nextcloud/migrations/migrate +++ b/library/ix-dev/charts/nextcloud/migrations/migrate @@ -93,13 +93,18 @@ def migrate_common_lib(values): return values def migrate(values): - if 'isDataInTheSameVolume' in values.keys(): + if 'isDataInTheSameVolume' in values.keys() or 'shouldShowStorageToggle' in values.keys(): values['ncStorage']['isDataInTheSameVolume'] = values.pop('isDataInTheSameVolume', True) values['ncStorage']['shouldShowStorageToggle'] = values.pop('shouldShowStorageToggle', True) return values # If this missing, we have already migrated if not 'appVolumeMounts' in values.keys(): + # If 'shouldFixMigration' missing, we should fix migration and then add the key + if not 'migrationFixed' in values['ncStorage'].keys(): + values['ncStorage']['shouldShowStorageToggle'] = True + values['ncStorage']['isDataInTheSameVolume'] = True + values['ncStorage']['migrationFixed'] = True return values diff --git a/library/ix-dev/charts/nextcloud/questions.yaml b/library/ix-dev/charts/nextcloud/questions.yaml index 8929a49912..a5975f8cfb 100644 --- a/library/ix-dev/charts/nextcloud/questions.yaml +++ b/library/ix-dev/charts/nextcloud/questions.yaml @@ -254,6 +254,13 @@ questions: type: boolean default: false hidden: true + # Dummy variable so we can skip "fixing" migration on new installations + - variable: migrationFixed + label: "" + schema: + type: boolean + default: true + hidden: true - variable: isDataInTheSameVolume label: "Pre v2 Storage Structure (See the tooltip for more information)" description: |