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

Commit

Permalink
Allow Windows and Linux to have different default versions (#2988)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis authored May 16, 2018
1 parent f699024 commit 516e6ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/api/common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ const (
const (
// KubernetesDefaultRelease is the default Kubernetes release
KubernetesDefaultRelease string = "1.8"
// KubernetesDefaultReleaseWindows is the default Kubernetes release
KubernetesDefaultReleaseWindows string = "1.9"
)

const (
Expand Down
7 changes: 6 additions & 1 deletion pkg/api/common/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ func GetDefaultKubernetesVersion() string {
return GetLatestPatchVersion(KubernetesDefaultRelease, GetAllSupportedKubernetesVersions())
}

// GetDefaultKubernetesVersionWindows returns the default Kubernetes version for Windows, that is the latest patch of the default release
func GetDefaultKubernetesVersionWindows() string {
return GetLatestPatchVersion(KubernetesDefaultReleaseWindows, GetAllSupportedKubernetesVersionsWindows())
}

// GetSupportedKubernetesVersion verifies that a passed-in version string is supported, or returns a default version string if not
func GetSupportedKubernetesVersion(version string) string {
if k8sVersion := version; AllKubernetesSupportedVersions[k8sVersion] {
Expand Down Expand Up @@ -225,7 +230,7 @@ func GetSupportedVersions(orchType string, hasWindows bool) (versions []string,
switch orchType {
case Kubernetes:
if hasWindows {
return GetAllSupportedKubernetesVersionsWindows(), GetDefaultKubernetesVersion()
return GetAllSupportedKubernetesVersionsWindows(), GetDefaultKubernetesVersionWindows()
}
return GetAllSupportedKubernetesVersions(), GetDefaultKubernetesVersion()

Expand Down

0 comments on commit 516e6ba

Please sign in to comment.