Эх сурвалжийг харах

Update plex migration to use updateStrategy

Waqar Ahmed 4 жил өмнө
parent
commit
9bcb41d9d5

+ 16 - 13
test/plex/1.0.1/migrations/migrate.py

@@ -1,16 +1,19 @@
 def migrate(values):
-    values['appVolumeMounts'] = {
-        'transcode': {
-            'hostPathEnabled': values['transcodeHostPathEnabled'],
-            **({'hostPath': values['transcodeHostPath']} if values.get('transcodeHostPath') else {})
+    values.update({
+        'appVolumeMounts': {
+            'transcode': {
+                'hostPathEnabled': values['transcodeHostPathEnabled'],
+                **({'hostPath': values['transcodeHostPath']} if values.get('transcodeHostPath') else {})
+            },
+            'config': {
+                'hostPathEnabled': values['configHostPathEnabled'],
+                **({'hostPath': values['configHostPath']} if values.get('configHostPath') else {})
+            },
+            'data': {
+                'hostPathEnabled': values['dataHostPathEnabled'],
+                **({'hostPath': values['dataHostPath']} if values.get('dataHostPath') else {})
+            },
         },
-        'config': {
-            'hostPathEnabled': values['configHostPathEnabled'],
-            **({'hostPath': values['configHostPath']} if values.get('configHostPath') else {})
-        },
-        'data': {
-            'hostPathEnabled': values['dataHostPathEnabled'],
-            **({'hostPath': values['dataHostPath']} if values.get('dataHostPath') else {})
-        },
-    }
+        'updateStrategy': values.get('strategyType', 'Recreate'),
+    })
     return values

+ 1 - 1
test/plex/1.0.1/questions.yaml

@@ -113,7 +113,7 @@ questions:
         - "definitions/timezone"
 
   # Update strategy
-  - variable: strategyType
+  - variable: updateStrategy
     description: "Upgrade Policy"
     label: "Update Strategy"
     group: "Scaling/Upgrade Policy"