mirror of
https://github.com/truenas/charts.git
synced 2026-04-24 02:20:15 +08:00
27 lines
678 B
Python
Executable File
27 lines
678 B
Python
Executable File
#!/usr/bin/python3
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
|
|
def migrate(values):
|
|
values.update({
|
|
'appVolumeMounts': {
|
|
'nextcloud-data': {
|
|
'hostPathEnabled': values['nextcloudDataHostPathEnabled'],
|
|
**({'hostPath': values['nextcloudHostPath']} if values.get('nextcloudHostPath') else {})
|
|
},
|
|
},
|
|
'updateStrategy': values.get('nextcloud').get('strategy', 'Recreate'),
|
|
})
|
|
return values
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if len(sys.argv) != 2:
|
|
exit(1)
|
|
|
|
if os.path.exists(sys.argv[1]):
|
|
with open(sys.argv[1], 'r') as f:
|
|
print(json.dumps(migrate(json.loads(f.read()))))
|