Simplify some upgrader version cases (#3924)

This commit is contained in:
Matt Boersma 2018-10-02 14:44:48 -06:00 коммит произвёл Jack Francis
Родитель 3db0080828
Коммит b3f4d1544e
1 изменённых файлов: 5 добавлений и 15 удалений

Просмотреть файл

@ -112,23 +112,13 @@ func (uc *UpgradeCluster) UpgradeCluster(subscriptionID uuid.UUID, kubeConfig, r
case strings.HasPrefix(upgradeVersion, "1.8."):
upgrader18 := &Kubernetes18upgrader{}
upgrader18.Init(uc.Translator, uc.Logger, uc.ClusterTopology, uc.Client, kubeConfig, uc.StepTimeout, acsengineVersion)
upgrader = upgrader18
case strings.HasPrefix(upgradeVersion, "1.9."):
upgrader19 := &Upgrader{}
upgrader19.Init(uc.Translator, uc.Logger, uc.ClusterTopology, uc.Client, kubeConfig, uc.StepTimeout, acsengineVersion)
upgrader = upgrader19
case strings.HasPrefix(upgradeVersion, "1.10."):
upgrader110 := &Upgrader{}
upgrader110.Init(uc.Translator, uc.Logger, uc.ClusterTopology, uc.Client, kubeConfig, uc.StepTimeout, acsengineVersion)
upgrader = upgrader110
case strings.HasPrefix(upgradeVersion, "1.11."):
upgrader111 := &Upgrader{}
upgrader111.Init(uc.Translator, uc.Logger, uc.ClusterTopology, uc.Client, kubeConfig, uc.StepTimeout, acsengineVersion)
upgrader = upgrader111
case strings.HasPrefix(upgradeVersion, "1.9."),
strings.HasPrefix(upgradeVersion, "1.10."),
strings.HasPrefix(upgradeVersion, "1.11."):
upgrader := &Upgrader{}
upgrader.Init(uc.Translator, uc.Logger, uc.ClusterTopology, uc.Client, kubeConfig, uc.StepTimeout, acsengineVersion)
default:
return uc.Translator.Errorf("Upgrade to Kubernetes version %s is not supported", upgradeVersion)