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

feat: add support for Kubernetes v1.18.16 #4284

Merged
merged 4 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/api/common/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ var AllKubernetesSupportedVersions = map[string]bool{
"1.18.12": false,
"1.18.13": false,
"1.18.14": false,
"1.18.15": true,
"1.18.15": false,
"1.18.16": true,
"1.19.0-alpha.1": false,
"1.19.0-alpha.2": false,
"1.19.0-alpha.3": false,
Expand Down
10 changes: 5 additions & 5 deletions pkg/api/vlabs/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4630,7 +4630,7 @@ func TestValidateLocation(t *testing.T) {
},
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, true),
KubernetesConfig: &KubernetesConfig{
UseInstanceMetadata: to.BoolPtr(trueVal),
},
Expand All @@ -4651,7 +4651,7 @@ func TestValidateLocation(t *testing.T) {
},
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, true),
KubernetesConfig: &KubernetesConfig{
EtcdDiskSizeGB: "1024",
},
Expand All @@ -4672,7 +4672,7 @@ func TestValidateLocation(t *testing.T) {
},
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, true),
KubernetesConfig: &KubernetesConfig{
EtcdDiskSizeGB: "1024GB",
},
Expand All @@ -4693,7 +4693,7 @@ func TestValidateLocation(t *testing.T) {
},
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, true),
},
AgentPoolProfiles: []*AgentPoolProfile{
{
Expand All @@ -4719,7 +4719,7 @@ func TestValidateLocation(t *testing.T) {
},
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, true),
},
AgentPoolProfiles: []*AgentPoolProfile{
{
Expand Down
38 changes: 19 additions & 19 deletions pkg/operations/kubernetesupgrade/upgradecluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should succeed when cluster VMs are missing expected tags during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.15", 1, 1, false)
cs := api.CreateMockContainerService("testcluster", "", 1, 1, false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100% of UT should not care about our maintaining the versions support list, so shout if this ever bites you in the future!

cc @mboersma

uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -87,7 +87,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to list VMs during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.15", 1, 1, false)
cs := api.CreateMockContainerService("testcluster", "", 1, 1, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -113,7 +113,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to delete VMs during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.15", 1, 1, false)
cs := api.CreateMockContainerService("testcluster", "", 1, 1, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -136,7 +136,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to deploy template during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.15", 1, 1, false)
cs := api.CreateMockContainerService("testcluster", "", 1, 1, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -159,7 +159,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 := api.CreateMockContainerService("testcluster", "1.18.15", 1, 6, false)
cs := api.CreateMockContainerService("testcluster", "", 1, 6, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -182,7 +182,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to get storage client during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.15", 5, 1, false)
cs := api.CreateMockContainerService("testcluster", "", 5, 1, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -205,7 +205,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to delete network interface during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.15", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "", 3, 2, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -228,7 +228,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to delete role assignment during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.15", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig = &api.KubernetesConfig{}
cs.Properties.OrchestratorProfile.KubernetesConfig.UseManagedIdentity = to.BoolPtr(true)
uc := UpgradeCluster{
Expand Down Expand Up @@ -262,7 +262,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {

BeforeEach(func() {
mockClient = armhelpers.MockAKSEngineClient{MockKubernetesClient: &armhelpers.MockKubernetesClient{}}
cs = api.CreateMockContainerService("testcluster", "1.18.15", 3, 3, false)
cs = api.CreateMockContainerService("testcluster", "1.16.15", 3, 3, false)
uc = UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand Down Expand Up @@ -291,10 +291,10 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
It("Should skip VMs that are already on desired version", func() {
mockClient.FakeListVirtualMachineScaleSetVMsResult = func() []compute.VirtualMachineScaleSetVM {
return []compute.VirtualMachineScaleSetVM{
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.18.15"),
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.18.10"),
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.18.9"),
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.18.15"),
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.16.15"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to prevent any unnecessary search/replace queries from coming up in the past, setting these UT data to a permanently deprecated version (the UT are just testing for version equality, they don't care about the supported versions list)

mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.16.10"),
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.16.9"),
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.16.15"),
}
}
uc.Force = false
Expand Down Expand Up @@ -362,9 +362,9 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
It("Should use kubernetes api to get node versions for VMSS when latest model is not applied", func() {
trueVar := true
falseVar := false
vmWithoutLatestModelApplied := mockClient.MakeFakeVirtualMachineScaleSetVMWithGivenName("Kubernetes:1.18.15", "vmWithoutLatestModelApplied!")
vmWithoutLatestModelApplied := mockClient.MakeFakeVirtualMachineScaleSetVMWithGivenName("Kubernetes:1.16.15", "vmWithoutLatestModelApplied!")
vmWithoutLatestModelApplied.VirtualMachineScaleSetVMProperties.LatestModelApplied = &falseVar
vmWithLatestModelApplied := mockClient.MakeFakeVirtualMachineScaleSetVMWithGivenName("Kubernetes:1.18.15", "vmWithLatestModelApplied")
vmWithLatestModelApplied := mockClient.MakeFakeVirtualMachineScaleSetVMWithGivenName("Kubernetes:1.16.15", "vmWithLatestModelApplied")
vmWithLatestModelApplied.VirtualMachineScaleSetVMProperties.LatestModelApplied = &trueVar

mockClient.MockKubernetesClient.GetNodeFunc = func(name string) (*v1.Node, error) {
Expand Down Expand Up @@ -622,7 +622,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
Expect(*uc.UpgradedMasterVMs).To(HaveLen(0))
})
It("Should leave platform fault domain count nil", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.15", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig = &api.KubernetesConfig{}
cs.Properties.OrchestratorProfile.KubernetesConfig.UseManagedIdentity = to.BoolPtr(true)
cs.Properties.MasterProfile.AvailabilityProfile = "AvailabilitySet"
Expand Down Expand Up @@ -715,7 +715,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should not fail if no managed identity is returned by azure during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.15", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig = &api.KubernetesConfig{}
cs.Properties.OrchestratorProfile.KubernetesConfig.UseManagedIdentity = to.BoolPtr(true)
uc := UpgradeCluster{
Expand All @@ -738,7 +738,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should not fail if a Kubernetes client cannot be created", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.15", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "", 3, 2, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand Down Expand Up @@ -772,7 +772,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should fail if cluster-autoscaler cannot be paused unless --force is specified", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.15", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "", 3, 2, false)
enabled := true
addon := api.KubernetesAddon{
Name: "cluster-autoscaler",
Expand Down
2 changes: 1 addition & 1 deletion vhd/packer/configure-windows-vhd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function Get-FilesToCacheOnVHD {
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.17.17-azs/windowszip/v1.17.17-azs-1int.zip",
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.18.15-azs/windowszip/v1.18.15-azs-1int.zip",
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.17.17/windowszip/v1.17.17-1int.zip",
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.18.15/windowszip/v1.18.15-1int.zip",
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.18.16/windowszip/v1.18.16-1int.zip",
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.19.8/windowszip/v1.19.8-1int.zip",
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.20.4/windowszip/v1.20.4-1int.zip",
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.21.0-alpha.3/windowszip/v1.21.0-alpha.3-1int.zip"
Expand Down
2 changes: 1 addition & 1 deletion vhd/packer/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ K8S_VERSIONS="
1.21.0-alpha.3
1.20.4
1.19.8
1.18.15
1.18.16
1.18.15-azs
1.17.17
1.17.17-azs
Expand Down