diff --git a/netclient/functions/clientconfig.go b/netclient/functions/clientconfig.go index 3b1fbdf5..67793abd 100644 --- a/netclient/functions/clientconfig.go +++ b/netclient/functions/clientconfig.go @@ -14,6 +14,7 @@ import ( // Usage : set update required to true and and update logic to function func UpdateClientConfig() { defer upgrades.ReleaseUpgrades() + upgrades.InitializeUpgrades() networks, _ := ncutils.GetSystemNetworks() if len(networks) == 0 { diff --git a/netclient/functions/upgrades/upgrades.go b/netclient/functions/upgrades/upgrades.go index 77dab11a..ffdf9cfc 100644 --- a/netclient/functions/upgrades/upgrades.go +++ b/netclient/functions/upgrades/upgrades.go @@ -1,10 +1,11 @@ package upgrades -func init() { +// InitializeUpgrades - initializes written upgrades +func InitializeUpgrades() { addUpgrades([]UpgradeInfo{ upgrade0145, upgrade0146, - upgrade0148, + upgrade0160, }) } diff --git a/netclient/functions/upgrades/v0-14-8.go b/netclient/functions/upgrades/v0-14-8.go deleted file mode 100644 index af87e1b7..00000000 --- a/netclient/functions/upgrades/v0-14-8.go +++ /dev/null @@ -1,22 +0,0 @@ -package upgrades - -import ( - "github.com/gravitl/netmaker/netclient/config" -) - -var upgrade0148 = UpgradeInfo{ - RequiredVersions: []string{ - "v0.14.5", - "v0.14.6", - "v0.14.7", - }, - NewVersion: "v0.14.8", - OP: update0148, -} - -func update0148(cfg *config.ClientConfig) { - // set connect default if not present 14.X -> 14.8 - if cfg.Node.Connected == "" { - cfg.Node.SetDefaultConnected() - } -} diff --git a/netclient/functions/upgrades/v0-16-0.go b/netclient/functions/upgrades/v0-16-0.go new file mode 100644 index 00000000..43dac44c --- /dev/null +++ b/netclient/functions/upgrades/v0-16-0.go @@ -0,0 +1,21 @@ +package upgrades + +import ( + "github.com/gravitl/netmaker/netclient/config" +) + +var upgrade0160 = UpgradeInfo{ + RequiredVersions: []string{ + "v0.15.1", + "v0.15.2", + }, + NewVersion: "v0.16.0", + OP: update0160, +} + +func update0160(cfg *config.ClientConfig) { + // set connect default if not present 15.X -> 16.0 + if cfg.Node.Connected == "" { + cfg.Node.SetDefaultConnected() + } +}