-
Notifications
You must be signed in to change notification settings - Fork 560
Allow deprecating k8s versions #3493
Allow deprecating k8s versions #3493
Conversation
pkg/api/common/versions.go
Outdated
allSupportedVersions = AllKubernetesWindowsSupportedVersions | ||
} | ||
for ver, supported := range allSupportedVersions { | ||
if (isCreate && supported) || !isCreate { |
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 is the key change in this PR
708abd7
to
6aceddb
Compare
@@ -235,28 +239,11 @@ func getAllKubernetesWindowsSupportedVersionsMap() map[string]bool { | |||
return ret | |||
} | |||
|
|||
// GetAllSupportedKubernetesVersionsWindows returns a slice of all supported Kubernetes versions on Windows | |||
func GetAllSupportedKubernetesVersionsWindows() []string { |
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.
combined GetAllSupportedKubernetesVersionsWindows() with GetAllSupportedKubernetesVersions()
allSupportedVersions = AllKubernetesWindowsSupportedVersions | ||
} | ||
for ver, supported := range allSupportedVersions { | ||
if (!isUpdate && supported) || isUpdate { |
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 is the key change in this PR
241a61d
to
f0bc09d
Compare
Codecov Report
@@ Coverage Diff @@
## master #3493 +/- ##
==========================================
- Coverage 55.41% 55.39% -0.02%
==========================================
Files 108 108
Lines 16098 16102 +4
==========================================
Hits 8920 8920
- Misses 6412 6415 +3
- Partials 766 767 +1 |
Tests running on CecileRobertMichon/acs-engine@k8s-versions-distinct...CecileRobertMichon:test-deprecate-versions (disables all versions expect [1.8.15 1.9.9 1.10.5 1.11.0]) Deploy a deprecated version (expected to fail): https://jenkins.azure-containers.io/view/acs-engine%20ad-hoc/job/k8s-deployment/206/console |
TODO:
|
After thinking about this some more, I don't think we should do
The validate happens at https://github.com/Azure/acs-engine/blob/master/cmd/upgrade.go#L141 and actually makes sure that the apimodel passed in by the user is valid. If we do not validate it, there is no garantee that the apimodel passed in with the |
@@ -365,7 +365,7 @@ var ( | |||
func setPropertiesDefaults(cs *api.ContainerService, isUpgrade, isScale bool) (bool, error) { | |||
properties := cs.Properties | |||
|
|||
setOrchestratorDefaults(cs) | |||
setOrchestratorDefaults(cs, isUpgrade || isScale) |
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.
isUpgrade || isScale <=> isUpdate
ret := []*OrchestratorProfile{} | ||
|
||
currentVer, err := semver.Make(csOrch.OrchestratorVersion) | ||
if err != nil { | ||
return nil, err | ||
} | ||
nextNextMinorString := strconv.FormatUint(currentVer.Major, 10) + "." + strconv.FormatUint(currentVer.Minor+2, 10) + ".0" | ||
upgradeableVersions := common.GetVersionsBetween(common.GetAllSupportedKubernetesVersions(), csOrch.OrchestratorVersion, nextNextMinorString, false, true) | ||
nextNextMinorString := strconv.FormatUint(currentVer.Major, 10) + "." + strconv.FormatUint(currentVer.Minor+2, 10) + ".0-alpha.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.
fix bug where pre-releases were include in previous previous minor version upgrades
ecc169c
to
fa4a3e8
Compare
wip merge windows and non-windows k8s versions add isupdate logic add missing args add isCreate to defaults set orchestratorDefaults args fmt change isCreate to isUpdate merge getDefaultVersion fix !isUpdate arg remove windows versions
fa4a3e8
to
12a276d
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon, jackfrancis 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 |
What this PR does / why we need it: This PR allows removing support for k8s versions (by setting the "supported" value to false in the version map) and keep support for scaling/upgrading those clusters
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #3399Special notes for your reviewer:
If applicable:
Release note: