mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
changed requiredversion to requiredversions
This commit is contained in:
@@ -24,7 +24,8 @@ func UpdateClientConfig() {
|
|||||||
//update any new fields
|
//update any new fields
|
||||||
configChanged := false
|
configChanged := false
|
||||||
for _, u := range upgrades.Upgrades {
|
for _, u := range upgrades.Upgrades {
|
||||||
if cfg.Node.Version == u.RequiredVersion {
|
if ncutils.StringSliceContains(u.RequiredVersions, cfg.Node.Version) {
|
||||||
|
logger.Log(0, "upgrading node", cfg.Node.Name, "on network", cfg.Node.Network, "from", cfg.Node.Version, "to", u.NewVersion)
|
||||||
upgrades.UpgradeFunction(u.OP)(&cfg)
|
upgrades.UpgradeFunction(u.OP)(&cfg)
|
||||||
cfg.Node.Version = u.NewVersion
|
cfg.Node.Version = u.NewVersion
|
||||||
configChanged = true
|
configChanged = true
|
||||||
|
@@ -7,7 +7,7 @@ type UpgradeFunction func(*config.ClientConfig)
|
|||||||
|
|
||||||
// UpgradeInfo - struct for holding upgrade info
|
// UpgradeInfo - struct for holding upgrade info
|
||||||
type UpgradeInfo struct {
|
type UpgradeInfo struct {
|
||||||
RequiredVersion string
|
RequiredVersions []string
|
||||||
NewVersion string
|
NewVersion string
|
||||||
OP UpgradeFunction
|
OP UpgradeFunction
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,7 @@ package upgrades
|
|||||||
import "github.com/gravitl/netmaker/netclient/config"
|
import "github.com/gravitl/netmaker/netclient/config"
|
||||||
|
|
||||||
var upgrade0145 = UpgradeInfo{
|
var upgrade0145 = UpgradeInfo{
|
||||||
RequiredVersion: "0.14.4",
|
RequiredVersions: []string{"0.14.1", "0.14.2", "0.14.3", "0.14.4"},
|
||||||
NewVersion: "0.14.5",
|
NewVersion: "0.14.5",
|
||||||
OP: update0145,
|
OP: update0145,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user