mirror of
https://github.com/truenas/charts.git
synced 2026-11-12 22:43:24 +00:00
NAS-122030 / 23.10 / Adds check to only render hostPath key if it has a value (#1210)
* Remove hostPath key from values.yaml * Add migrations * bump * rename migration files and make it safer * fix wrongly nested dict
This commit is contained in:
1 parent
99f57d4ab3
commit
85d2fab14d
63 files changed
+629
-61
No files matched your search
@@ -3,7 +3,7 @@ description: High Performance, Kubernetes Native Object Storage
|
||||
annotations:
|
||||
title: MinIO
|
||||
type: application
|
||||
version: 1.0.9
|
||||
version: 1.0.10
|
||||
apiVersion: v2
|
||||
appVersion: '2023-03-24'
|
||||
kubeVersion: '>=1.16.0-0'
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/python3
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def migrate(values):
|
||||
storageKey = 'minioLogging'
|
||||
storageSubKey = 'logsearch'
|
||||
storages = ['pgData', 'pgData']
|
||||
|
||||
for storage in storages:
|
||||
check_val = values.get(storageKey, {}).get(storageSubKey, {}).get(storage, {})
|
||||
if not isinstance(check_val, dict) or not check_val or check_val.get('type', 'hostPath') == 'hostPath':
|
||||
continue
|
||||
|
||||
values[storageKey][storageSubKey][storage] = {key: value for key, value in check_val.items() if key != 'hostPath'}
|
||||
|
||||
|
||||
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()))))
|
||||
@@ -42,9 +42,7 @@ minioLogging:
|
||||
diskCapacityGB: 5
|
||||
pgData:
|
||||
type: ixVolume
|
||||
hostPath: ''
|
||||
datasetName: postgres-data
|
||||
pgBackup:
|
||||
type: ixVolume
|
||||
hostPath: ''
|
||||
datasetName: postgres-backup
|
||||
Reference in new issue
Block a user