Browse Source

fix typo in migration (#2185)

* fix typo in migration

* cleaner

* Update migrate
Stavros Kois 1 year ago
parent
commit
db62ed3f75

+ 1 - 1
library/ix-dev/charts/pihole/Chart.yaml

@@ -3,7 +3,7 @@ description: DNS and Ad-filtering for your network.
 annotations:
   title: Pi-hole
 type: application
-version: 2.0.2
+version: 2.0.3
 apiVersion: v2
 appVersion: 2023.11.0
 kubeVersion: '>=1.16.0-0'

+ 5 - 1
library/ix-dev/charts/pihole/migrations/migrate

@@ -60,7 +60,7 @@ def migrate_common_lib(values):
         # Migrate Storage
         'piholeStorage': {
             'config': migrate_volume(values['appVolumeMounts']['config']),
-            'cache': migrate_volume(values['appVolumeMounts']['dnsmasq']),
+            'dnsmasq': migrate_volume(values['appVolumeMounts']['dnsmasq']),
             'additionalStorages': [
                 {
                     'type': 'hostPath',
@@ -83,6 +83,10 @@ def migrate(values):
     if not 'appVolumeMounts' in values.keys():
         return values
 
+    # Handle typo for users that already gone through the migration
+    if 'cache' in values['piholeStorage'].keys():
+        values['piholeStorage']['dnsmasq'] = values['piholeStorage'].pop('cache')
+
     return migrate_common_lib(values)