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

Commit

Permalink
add k8s v1.7.15 support (#2490)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis authored Mar 20, 2018
1 parent e22b3fc commit 8f6a259
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 21 deletions.
1 change: 1 addition & 0 deletions pkg/acsengine/k8s_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,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.KubernetesVersion1Dot7Dot15: getK8sVersionComponents("1.7.15", map[string]string{"windowszip": "v1.7.15-1int.zip"}),
common.KubernetesVersion1Dot7Dot14: getK8sVersionComponents("1.7.14", map[string]string{"windowszip": "v1.7.14-1int.zip"}),
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"}),
Expand Down
4 changes: 4 additions & 0 deletions pkg/api/common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ const (
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"
// KubernetesVersion1Dot7Dot15 is the major.minor.patch string for the 1.7.15 version of kubernetes
KubernetesVersion1Dot7Dot15 string = "1.7.15"
// 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 @@ -141,6 +143,7 @@ var AllKubernetesSupportedVersions = map[string]bool{
KubernetesVersion1Dot7Dot12: true,
KubernetesVersion1Dot7Dot13: true,
KubernetesVersion1Dot7Dot14: true,
KubernetesVersion1Dot7Dot15: true,
KubernetesVersion1Dot8Dot0: true,
KubernetesVersion1Dot8Dot1: true,
KubernetesVersion1Dot8Dot2: true,
Expand Down Expand Up @@ -188,6 +191,7 @@ var AllKubernetesWindowsSupportedVersions = map[string]bool{
KubernetesVersion1Dot7Dot12: true,
KubernetesVersion1Dot7Dot13: true,
KubernetesVersion1Dot7Dot14: true,
KubernetesVersion1Dot7Dot15: true,
KubernetesVersion1Dot8Dot0: true,
KubernetesVersion1Dot8Dot1: true,
KubernetesVersion1Dot8Dot2: true,
Expand Down
18 changes: 9 additions & 9 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 != KubernetesVersion1Dot7Dot14 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot7Dot14)
if version != KubernetesVersion1Dot7Dot15 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot7Dot15)
}

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 != KubernetesVersion1Dot7Dot14 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot7Dot14)
if version != KubernetesVersion1Dot7Dot15 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot7Dot15)
}

version = GetLatestPatchVersion("1.8", GetAllSupportedKubernetesVersions())
Expand Down Expand Up @@ -94,18 +94,18 @@ func Test_RationalizeReleaseAndVersion(t *testing.T) {
}

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

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.7", "1.7.15", false)
if version != KubernetesVersion1Dot7Dot15 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot7Dot15)
}

version = RationalizeReleaseAndVersion(Kubernetes, "", "1.6.7", false)
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, 1.7.14
Expect(len(orch.Upgrades)).To(Equal(15))
// 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, 1.7.15
Expect(len(orch.Upgrades)).To(Equal(16))

// 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.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, 1.8.10
Expect(len(orch.Upgrades)).To(Equal(19))
// 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.7.15, 1.8.0, 1.8.1, 1.8.2, 1.8.4, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.8.10
Expect(len(orch.Upgrades)).To(Equal(20))

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

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

func TestKubernetesInfo(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions pkg/api/vlabs/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ func (a *KubernetesConfig) Validate(k8sVersion string) error {
common.KubernetesVersion1Dot7Dot12: true,
common.KubernetesVersion1Dot7Dot13: true,
common.KubernetesVersion1Dot7Dot14: true,
common.KubernetesVersion1Dot7Dot15: true,
common.KubernetesVersion1Dot6Dot6: true,
common.KubernetesVersion1Dot6Dot9: true,
common.KubernetesVersion1Dot6Dot11: true,
Expand Down
8 changes: 4 additions & 4 deletions pkg/api/vlabs/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,15 +580,15 @@ func TestWindowsVersions(t *testing.T) {
}

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

p = getK8sDefaultProperties(true)
p.OrchestratorProfile.OrchestratorVersion = "1.7.15"
p.OrchestratorProfile.OrchestratorVersion = "1.7.16"
if err := p.Validate(false); err == nil {
t.Errorf(
"should error on invalid Windows version",
Expand Down Expand Up @@ -678,15 +678,15 @@ func TestLinuxVersions(t *testing.T) {
}

p = getK8sDefaultProperties(false)
p.OrchestratorProfile.OrchestratorVersion = "1.7.14"
p.OrchestratorProfile.OrchestratorVersion = "1.7.15"
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"
p.OrchestratorProfile.OrchestratorVersion = "1.7.16"
if err := p.Validate(false); err == nil {
t.Errorf(
"should error on invalid Linux version",
Expand Down

0 comments on commit 8f6a259

Please sign in to comment.