-
Notifications
You must be signed in to change notification settings - Fork 521
chore: deprecate support for creating new 1.16 clusters #4256
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4256 +/- ##
==========================================
- Coverage 72.08% 72.07% -0.02%
==========================================
Files 141 141
Lines 21715 21676 -39
==========================================
- Hits 15653 15622 -31
+ Misses 5107 5105 -2
+ Partials 955 949 -6
Continue to review full report at Codecov.
|
@@ -97,11 +97,7 @@ func (cs *ContainerService) setAPIServerConfig() { | |||
|
|||
// RBAC configuration | |||
if to.Bool(o.KubernetesConfig.EnableRbac) { | |||
if common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.7.0") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting rid of these unnecessary version checks
@@ -113,12 +109,6 @@ func (cs *ContainerService) setAPIServerConfig() { | |||
admissionControlKey, admissionControlValues := getDefaultAdmissionControls(cs) | |||
defaultAPIServerConfig[admissionControlKey] = admissionControlValues | |||
|
|||
// Enable VolumeSnapshotDataSource feature gate for Azure Disk CSI Driver | |||
// which is disabled from 1.13 to 1.16 by default | |||
if !common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.17.0") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto (we're always >= 1.17.0 starting with this PR)
@@ -261,16 +261,6 @@ func TestAPIServerConfigEnableRbac(t *testing.T) { | |||
a["--authorization-mode"]) | |||
} | |||
|
|||
// Test EnableRbac = true with 1.6 cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests are no longer relevant
@@ -495,27 +475,17 @@ func TestAPIServerCosmosEtcd(t *testing.T) { | |||
} | |||
|
|||
func TestAPIServerFeatureGates(t *testing.T) { | |||
// Test 1.13 <= k8s <= 1.16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests are no longer relevant
@@ -32,11 +30,8 @@ func (cs *ContainerService) setCloudControllerManagerConfig() { | |||
"--v": "2", | |||
} | |||
|
|||
// Add new arguments for Azure cloud-controller-manager component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer relevant
cs := CreateMockContainerService("testcluster", k8sVersion, 3, 2, false) | ||
cs.setCloudControllerManagerConfig() | ||
cm := cs.Properties.OrchestratorProfile.KubernetesConfig.CloudControllerManagerConfig | ||
if cm["--controllers"] != "*,-cloud-node" { | ||
t.Fatalf("got unexpected '--controllers' Cloud Controller Manager config value for Kubernetes %s: %s", | ||
k8sVersion, cm["--controllers"]) | ||
} | ||
|
||
k8sVersion = "1.15.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer a relevant test
@@ -3161,15 +3161,8 @@ func TestEnableAggregatedAPIs(t *testing.T) { | |||
} | |||
|
|||
func TestCloudControllerManagerEnabled(t *testing.T) { | |||
// test that 1.16 defaults to false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test is no longer relevant
@@ -53,7 +53,11 @@ func CreateMockContainerService(containerServiceName, orchestratorVersion string | |||
|
|||
cs.Properties.OrchestratorProfile = &OrchestratorProfile{} | |||
cs.Properties.OrchestratorProfile.OrchestratorType = Kubernetes | |||
cs.Properties.OrchestratorProfile.OrchestratorVersion = orchestratorVersion | |||
if orchestratorVersion == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addition of giving significance to ""
means that we can invoke this mock func without passing an explicit version, and interpret that as "just make me a mock cluster config with the current default version". This way as the set of supported versions evolves over time we don't have to keep manually updating a bunch of UT.
@@ -229,10 +229,6 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error { | |||
if err != nil { | |||
return err | |||
} | |||
minVersion, err := semver.Make("1.7.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to validate against >= 1.7.0 anymore
@@ -254,30 +246,11 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error { | |||
} | |||
|
|||
if to.Bool(o.KubernetesConfig.EnableEncryptionWithExternalKms) { | |||
minVersion, err := semver.Make("1.10.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to validate against >= 1.10.0 anymore
if to.Bool(a.OrchestratorProfile.KubernetesConfig.UseManagedIdentity) && a.OrchestratorProfile.KubernetesConfig.UserAssignedID == "" { | ||
log.Warnf("Clusters with enableEncryptionWithExternalKms=true and system-assigned identity are not upgradable! You will not be able to upgrade your cluster using `aks-engine upgrade`") | ||
} | ||
} | ||
|
||
if o.KubernetesConfig.EnableRbac != nil && !o.KubernetesConfig.IsRBACEnabled() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to validate against >= 1.15.0 anymore
@@ -295,14 +268,6 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error { | |||
} | |||
|
|||
if o.KubernetesConfig.LoadBalancerSku == StandardLoadBalancerSku { | |||
minVersion, err := semver.Make("1.11.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to validate against >= 1.11.0 anymore
@@ -727,14 +687,6 @@ func (a *Properties) validateAddons(isUpdate bool) error { | |||
} | |||
} | |||
} | |||
case "nvidia-device-plugin": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to validate against >= 1.10.0 anymore
@@ -801,14 +753,6 @@ func (a *Properties) validateAddons(isUpdate bool) error { | |||
} else { | |||
return errors.Errorf("%s addon is deprecated for new clusters", common.FlannelAddonName) | |||
} | |||
case "azure-policy": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to validate against >= 1.14.0 anymore
@@ -92,35 +92,11 @@ func Test_OrchestratorProfile_Validate(t *testing.T) { | |||
}, | |||
expectedError: "enableAggregatedAPIs requires the enableRbac feature as a prerequisite", | |||
}, | |||
"should error when KubernetesConfig has enableRBAC disabled for >= 1.15": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got rid of a bunch of obsolete version-specific UT
setupValidVersions(map[string]bool{ | ||
"1.10.13": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strictly speaking this change wasn't necessary (it didn't traverse the versions allow list flow), but (IMO) it's good practice not to pin to a static version that eventually doesn't make sense (in this case 1.10.13 hasn't made sense for a long time)
@@ -6,7 +6,6 @@ | |||
}, | |||
"orchestratorProfile": { | |||
"orchestratorType": "Kubernetes", | |||
"orchestratorRelease": "1.20", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aramase is it important to include this 1.20 config here (for example, because this dualstack example doesn't work on versions older than 1.20) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dual-stack configurations should work for 1.17+. But we want to set to 1.20
because that's the recommended version for dual-stack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added back, thanks for clarifying!
@@ -2,7 +2,6 @@ | |||
"apiVersion": "vlabs", | |||
"properties": { | |||
"orchestratorProfile": { | |||
"orchestratorRelease": "1.17", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got rid of unnecessary version declarations in these configs so we don't have to be annoyed by them in the future
@@ -15,9 +15,6 @@ Here is an [example of a Kubernetes cluster with Availability Zones support](../ | |||
{ | |||
"apiVersion": "vlabs", | |||
"properties": { | |||
"orchestratorProfile": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I observed documentation referencing an older version I got rid of that
@@ -1,38 +0,0 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are no longer valid example api models at all, so cleaning them up while I'm here
@@ -668,53 +671,63 @@ func Test_IsSupportedKubernetesVersion(t *testing.T) { | |||
} | |||
|
|||
func Test_IsValidMinVersion(t *testing.T) { | |||
orchestratorRelease := "1.16" | |||
defaultVersion := RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these new foo allow us to UT the IsValidMinVersion
helper func in a resilient way doesn't depend upon a particular version being supported or unsupported
@@ -263,8 +263,8 @@ var AllKubernetesSupportedVersionsAzureStack = map[string]bool{ | |||
"1.16.10": false, | |||
"1.16.11": false, | |||
"1.16.13": false, | |||
"1.16.14": true, | |||
"1.16.15": true, | |||
"1.16.14": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map AllKubernetesWindowsSupportedVersionsAzureStack
(a few lines below) also needs to be updated.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jackfrancis, jadarsie The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Reason for Change:
This PR removes support for creating new v1.16.n clusters. In addition, lots of UT TLC to make the next version deprecation easier!
Issue Fixed:
Credit Where Due:
Does this change contain code from or inspired by another project?
If "Yes," did you notify that project's maintainers and provide attribution?
Requirements:
Notes: