Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Add support for k8s 1.7.14 (#2442)
Browse files Browse the repository at this point in the history
* add k8s 1.8.9

* add k8s 1.7.13

* fixed tests
  • Loading branch information
Cecile Robert-Michon authored and jackfrancis committed Mar 13, 2018
1 parent 9dbdeb6 commit 6ba4622
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cmd/orchestrators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var _ = Describe("The orchestrators command", func() {
It("should succeed", func() {
command := &orchestratorsCmd{
orchestrator: "kubernetes",
version: "1.7.13",
version: "1.7.14",
}

err := command.run(nil, nil)
Expand Down
6 changes: 6 additions & 0 deletions examples/k8s-upgrade/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ To get the list of all available Kubernetes versions and upgrades, run the *orch
{
"orchestratorVersion": "1.7.13"
},
{
"orchestratorVersion": "1.7.14"
},
{
"orchestratorVersion": "1.8.1"
},
Expand Down Expand Up @@ -94,6 +97,9 @@ To get the information specific to the cluster, provide its current orchestrator
{
"orchestratorVersion": "1.7.13"
},
{
"orchestratorVersion": "1.7.14"
},
{
"orchestratorVersion": "1.8.0"
},
Expand Down
1 change: 1 addition & 0 deletions pkg/acsengine/k8s_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ var KubeConfigs = map[string]map[string]string{
common.KubernetesVersion1Dot8Dot2: getK8sVersionComponents("1.8.2", map[string]string{"windowszip": "v1.8.2-2int.zip"}),
common.KubernetesVersion1Dot8Dot1: getK8sVersionComponents("1.8.1", map[string]string{"windowszip": "v1.8.1-2int.zip"}),
common.KubernetesVersion1Dot8Dot0: getK8sVersionComponents("1.8.0", map[string]string{"windowszip": "v1.8.0-2int.zip"}),
common.KubernetesVersion1Dot7Dot14: getK8sVersionComponents("1.7.14", nil),
common.KubernetesVersion1Dot7Dot13: getK8sVersionComponents("1.7.13", map[string]string{"windowszip": "v1.7.13-1int.zip"}),
common.KubernetesVersion1Dot7Dot12: getK8sVersionComponents("1.7.12", map[string]string{"windowszip": "v1.7.12-2int.zip"}),
common.KubernetesVersion1Dot7Dot10: getK8sVersionComponents("1.7.10", map[string]string{"windowszip": "v1.7.10-1int.zip"}),
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ const (
KubernetesVersion1Dot7Dot12 string = "1.7.12"
// KubernetesVersion1Dot7Dot13 is the major.minor.patch string for the 1.7.13 version of kubernetes
KubernetesVersion1Dot7Dot13 string = "1.7.13"
// KubernetesVersion1Dot7Dot14 is the major.minor.patch string for the 1.7.14 version of kubernetes
KubernetesVersion1Dot7Dot14 string = "1.7.14"
// KubernetesVersion1Dot6Dot6 is the major.minor.patch string for the 1.6.6 version of kubernetes
KubernetesVersion1Dot6Dot6 string = "1.6.6"
// KubernetesVersion1Dot6Dot9 is the major.minor.patch string for the 1.6.9 version of kubernetes
Expand Down Expand Up @@ -132,6 +134,7 @@ var AllKubernetesSupportedVersions = map[string]bool{
KubernetesVersion1Dot7Dot10: true,
KubernetesVersion1Dot7Dot12: true,
KubernetesVersion1Dot7Dot13: true,
KubernetesVersion1Dot7Dot14: true,
KubernetesVersion1Dot8Dot0: true,
KubernetesVersion1Dot8Dot1: true,
KubernetesVersion1Dot8Dot2: true,
Expand Down
23 changes: 19 additions & 4 deletions pkg/api/common/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func Test_GetValidPatchVersion(t *testing.T) {
}

version = GetValidPatchVersion(Kubernetes, "1.7.3")
if version != KubernetesVersion1Dot7Dot13 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot7Dot13)
if version != KubernetesVersion1Dot7Dot14 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot7Dot14)
}

version = GetValidPatchVersion(Kubernetes, "1.8.7")
Expand Down Expand Up @@ -46,8 +46,8 @@ func TestGetLatestPatchVersion(t *testing.T) {
}

version = GetLatestPatchVersion("1.7", GetAllSupportedKubernetesVersions())
if version != KubernetesVersion1Dot7Dot13 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot7Dot13)
if version != KubernetesVersion1Dot7Dot14 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot7Dot14)
}

version = GetLatestPatchVersion("1.8", GetAllSupportedKubernetesVersions())
Expand Down Expand Up @@ -93,6 +93,21 @@ func Test_RationalizeReleaseAndVersion(t *testing.T) {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot6Dot11)
}

version = RationalizeReleaseAndVersion(Kubernetes, "1.7", "", false)
if version != KubernetesVersion1Dot7Dot14 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot7Dot14)
}

version = RationalizeReleaseAndVersion(Kubernetes, "", "1.7.14", false)
if version != KubernetesVersion1Dot7Dot14 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot7Dot14)
}

version = RationalizeReleaseAndVersion(Kubernetes, "1.7", "1.7.14", false)
if version != KubernetesVersion1Dot7Dot14 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot7Dot14)
}

version = RationalizeReleaseAndVersion(Kubernetes, "", "1.6.7", false)
if version != "" {
t.Errorf("It is not empty string")
Expand Down
16 changes: 8 additions & 8 deletions pkg/api/orchestrators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ func TestOrchestratorUpgradeInfo(t *testing.T) {
}
orch, e := GetOrchestratorVersionProfile(csOrch)
Expect(e).To(BeNil())
// 1.6.9, 1.6.11, 1.6.12, 1.6.13, 1.7.0, 1.7.1, 1.7.2, 1.7.4, 1.7.5, 1.7.7, 1.7.9, 1.7.10, 1.7.12, 1.7.13
Expect(len(orch.Upgrades)).To(Equal(14))
// 1.6.9, 1.6.11, 1.6.12, 1.6.13, 1.7.0, 1.7.1, 1.7.2, 1.7.4, 1.7.5, 1.7.7, 1.7.9, 1.7.10, 1.7.12, 1.7.13, 1.7.14
Expect(len(orch.Upgrades)).To(Equal(15))

// 1.7.0 is upgradable to 1.7.x and 1.8.x
csOrch = &OrchestratorProfile{
Expand All @@ -67,13 +67,13 @@ func TestOrchestratorUpgradeInfo(t *testing.T) {
}
orch, e = GetOrchestratorVersionProfile(csOrch)
Expect(e).To(BeNil())
// 1.7.1, 1.7.2, 1.7.4, 1.7.5, 1.7.7, 1.7.9, 1.7.10, 1.7.12, 1.7.13, 1.8.0, 1.8.1, 1.8.2, 1.8.4, 1.8.6, 1.8.7, 1.8.8, 1.8.9
Expect(len(orch.Upgrades)).To(Equal(17))
// 1.7.1, 1.7.2, 1.7.4, 1.7.5, 1.7.7, 1.7.9, 1.7.10, 1.7.12, 1.7.13, 1.7.14, 1.8.0, 1.8.1, 1.8.2, 1.8.4, 1.8.6, 1.8.7, 1.8.8, 1.8.9
Expect(len(orch.Upgrades)).To(Equal(18))

// 1.7.13 is upgradable to 1.8.x
// 1.7.14 is upgradable to 1.8.x
csOrch = &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: "1.7.13",
OrchestratorVersion: "1.7.14",
}
orch, e = GetOrchestratorVersionProfile(csOrch)
Expect(e).To(BeNil())
Expand Down Expand Up @@ -102,12 +102,12 @@ func TestOrchestratorUpgradeInfo(t *testing.T) {
// v20170930 - all orchestrators
list, e := GetOrchestratorVersionProfileListV20170930("", "")
Expect(e).To(BeNil())
Expect(len(list.Properties.Orchestrators)).To(Equal(34))
Expect(len(list.Properties.Orchestrators)).To(Equal(35))

// v20170930 - kubernetes only
list, e = GetOrchestratorVersionProfileListV20170930(common.Kubernetes, "")
Expect(e).To(BeNil())
Expect(len(list.Properties.Orchestrators)).To(Equal(29))
Expect(len(list.Properties.Orchestrators)).To(Equal(30))
}

func TestKubernetesInfo(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/v20170930/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (o *OrchestratorProfile) ValidateForUpgrade() error {
case Kubernetes:
switch o.OrchestratorVersion {
case common.KubernetesVersion1Dot6Dot13:
case common.KubernetesVersion1Dot7Dot13:
case common.KubernetesVersion1Dot7Dot14:
default:
return fmt.Errorf("Upgrade to Kubernetes %s is not supported", o.OrchestratorVersion)
}
Expand Down
6 changes: 4 additions & 2 deletions pkg/api/vlabs/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ func (o *OrchestratorProfile) Validate(isUpdate bool) error {
o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot9 ||
o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot10 ||
o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot12 ||
o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot13 {
o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot13 ||
o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot14 {
return fmt.Errorf("enablePodSecurityPolicy is only supported in acs-engine for Kubernetes version %s or greater; unable to validate for Kubernetes version %s",
"1.8.0", o.OrchestratorVersion)
}
Expand Down Expand Up @@ -245,7 +246,7 @@ func (o *OrchestratorProfile) ValidateForUpgrade() error {
case Kubernetes:
switch o.OrchestratorVersion {
case common.KubernetesVersion1Dot6Dot13:
case common.KubernetesVersion1Dot7Dot13:
case common.KubernetesVersion1Dot7Dot14:
default:
return fmt.Errorf("Upgrade to Kubernetes version %s is not supported", o.OrchestratorVersion)
}
Expand Down Expand Up @@ -533,6 +534,7 @@ func (a *KubernetesConfig) Validate(k8sVersion string) error {
common.KubernetesVersion1Dot7Dot10: true,
common.KubernetesVersion1Dot7Dot12: true,
common.KubernetesVersion1Dot7Dot13: true,
common.KubernetesVersion1Dot7Dot14: true,
common.KubernetesVersion1Dot6Dot6: true,
common.KubernetesVersion1Dot6Dot9: true,
common.KubernetesVersion1Dot6Dot11: true,
Expand Down
20 changes: 18 additions & 2 deletions pkg/api/vlabs/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) {

// Tests that apply to 1.6 and later releases
for _, k8sVersion := range []string{common.KubernetesVersion1Dot6Dot11, common.KubernetesVersion1Dot6Dot12, common.KubernetesVersion1Dot6Dot13,
common.KubernetesVersion1Dot7Dot7, common.KubernetesVersion1Dot7Dot9, common.KubernetesVersion1Dot7Dot10, common.KubernetesVersion1Dot7Dot12, common.KubernetesVersion1Dot7Dot13,
common.KubernetesVersion1Dot7Dot7, common.KubernetesVersion1Dot7Dot9, common.KubernetesVersion1Dot7Dot10, common.KubernetesVersion1Dot7Dot12, common.KubernetesVersion1Dot7Dot13, common.KubernetesVersion1Dot7Dot14,
common.KubernetesVersion1Dot8Dot1, common.KubernetesVersion1Dot8Dot2, common.KubernetesVersion1Dot8Dot4, common.KubernetesVersion1Dot8Dot6, common.KubernetesVersion1Dot8Dot7, common.KubernetesVersion1Dot8Dot8, common.KubernetesVersion1Dot8Dot9,
common.KubernetesVersion1Dot9Dot0, common.KubernetesVersion1Dot9Dot1, common.KubernetesVersion1Dot9Dot2, common.KubernetesVersion1Dot9Dot3, common.KubernetesVersion1Dot9Dot4, common.KubernetesVersion1Dot10Dot0} {
c := KubernetesConfig{
Expand Down Expand Up @@ -587,6 +587,14 @@ func TestWindowsVersions(t *testing.T) {
)
}

p = getK8sDefaultProperties(true)
p.OrchestratorProfile.OrchestratorVersion = "1.7.14"
if err := p.Validate(false); err == nil {
t.Errorf(
"should error on invalid Windows version",
)
}

p = getK8sDefaultProperties(true)
p.OrchestratorProfile.OrchestratorRelease = "1.8"
if err := p.Validate(false); err != nil {
Expand Down Expand Up @@ -670,13 +678,21 @@ func TestLinuxVersions(t *testing.T) {
}

p = getK8sDefaultProperties(false)
p.OrchestratorProfile.OrchestratorVersion = "1.7.13"
p.OrchestratorProfile.OrchestratorVersion = "1.7.14"
if err := p.Validate(false); err != nil {
t.Errorf(
"should not error on valid Linux version: %v", err,
)
}

p = getK8sDefaultProperties(false)
p.OrchestratorProfile.OrchestratorVersion = "1.7.15"
if err := p.Validate(false); err == nil {
t.Errorf(
"should error on invalid Linux version",
)
}

p = getK8sDefaultProperties(false)
p.OrchestratorProfile.OrchestratorRelease = "1.8"
if err := p.Validate(false); err != nil {
Expand Down
10 changes: 5 additions & 5 deletions pkg/operations/kubernetesupgrade/upgradecluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
It("Should return error message when failing to list VMs during upgrade operation", func() {
cs := createContainerService("testcluster", common.KubernetesVersion1Dot6Dot9, 1, 1)

cs.Properties.OrchestratorProfile.OrchestratorVersion = common.KubernetesVersion1Dot7Dot13
cs.Properties.OrchestratorProfile.OrchestratorVersion = common.KubernetesVersion1Dot7Dot14

uc := UpgradeCluster{
Translator: &i18n.Translator{},
Expand All @@ -53,7 +53,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
It("Should return error message when failing to detete VMs during upgrade operation", func() {
cs := createContainerService("testcluster", common.KubernetesVersion1Dot6Dot9, 1, 1)

cs.Properties.OrchestratorProfile.OrchestratorVersion = common.KubernetesVersion1Dot7Dot13
cs.Properties.OrchestratorProfile.OrchestratorVersion = common.KubernetesVersion1Dot7Dot14
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand Down Expand Up @@ -91,7 +91,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {

It("Should return error message when failing to get a virtual machine during upgrade operation", func() {
cs := createContainerService("testcluster", common.KubernetesVersion1Dot6Dot9, 1, 6)
cs.Properties.OrchestratorProfile.OrchestratorVersion = common.KubernetesVersion1Dot7Dot13
cs.Properties.OrchestratorProfile.OrchestratorVersion = common.KubernetesVersion1Dot7Dot14
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -110,7 +110,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {

It("Should return error message when failing to get storage client during upgrade operation", func() {
cs := createContainerService("testcluster", common.KubernetesVersion1Dot6Dot9, 5, 1)
cs.Properties.OrchestratorProfile.OrchestratorVersion = common.KubernetesVersion1Dot7Dot13
cs.Properties.OrchestratorProfile.OrchestratorVersion = common.KubernetesVersion1Dot7Dot14
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -129,7 +129,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {

It("Should return error message when failing to delete network interface during upgrade operation", func() {
cs := createContainerService("testcluster", common.KubernetesVersion1Dot6Dot9, 3, 2)
cs.Properties.OrchestratorProfile.OrchestratorVersion = common.KubernetesVersion1Dot7Dot13
cs.Properties.OrchestratorProfile.OrchestratorVersion = common.KubernetesVersion1Dot7Dot14
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand Down

0 comments on commit 6ba4622

Please sign in to comment.