mirror of
https://github.com/truenas/charts.git
synced 2026-04-09 21:59:10 +08:00
wgeasy - fix migration order (#2628)
* wgeasy - fix migration order * add another failsafe
This commit is contained in:
@@ -3,7 +3,7 @@ description: WG-Easy is the easiest way to install & manage WireGuard!
|
||||
annotations:
|
||||
title: WG Easy
|
||||
type: application
|
||||
version: 2.0.18
|
||||
version: 2.0.19
|
||||
apiVersion: v2
|
||||
appVersion: '13'
|
||||
kubeVersion: '>=1.16.0-0'
|
||||
|
||||
@@ -37,6 +37,7 @@ def migrate_common_lib(values):
|
||||
# Migrate Config
|
||||
'wgConfig': {
|
||||
'host': values['wgeasy']['host'],
|
||||
'externalPort': values.get('wgUDPPort', 30057),
|
||||
'password': values['wgeasy'].get('password', ''),
|
||||
'keepAlive': values['wgeasy']['keep_alive'],
|
||||
'clientMTU': values['wgeasy']['client_mtu'],
|
||||
@@ -74,17 +75,22 @@ def migrate_common_lib(values):
|
||||
|
||||
return values
|
||||
|
||||
|
||||
def migrate(values):
|
||||
if not 'wgeasy' in values.keys():
|
||||
# If we have migrated...
|
||||
if 'wgConfig' in values.keys():
|
||||
# Make sure the externalPort is not missing.
|
||||
if not values['wgConfig'].get('externalPort', None):
|
||||
values['wgConfig']['externalPort'] = values['wgNetwork'].get('udpPort', 30057)
|
||||
return values
|
||||
|
||||
if not values['wgConfig'].get('externalPort', None):
|
||||
values['wgConfig']['externalPort'] = values['wgNetwork'].get('udpPort', 30057)
|
||||
# If this key is missing, we have already migrated.
|
||||
if 'wgeasy' not in values.keys():
|
||||
return values
|
||||
|
||||
return migrate_common_lib(values)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) != 2:
|
||||
exit(1)
|
||||
|
||||
Reference in New Issue
Block a user