-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add check for highest supported k8s version (#1336)
* Add highest supported k8s version * Add test for commons.py
- Loading branch information
Showing
7 changed files
with
40 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
TERRAFORM_VERSION = "1.0.5" | ||
|
||
HIGHEST_SUPPORTED_K8S_VERSION = "1.23.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from qhub.constants import HIGHEST_SUPPORTED_K8S_VERSION | ||
|
||
|
||
def filter_by_highest_supported_k8s_version(k8s_versions_list): | ||
filtered_k8s_versions_list = [] | ||
for k8s_version in k8s_versions_list: | ||
if k8s_version <= HIGHEST_SUPPORTED_K8S_VERSION: | ||
filtered_k8s_versions_list.append(k8s_version) | ||
return filtered_k8s_versions_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from qhub.provider.cloud.commons import filter_by_highest_supported_k8s_version | ||
|
||
|
||
def test_filter_by_highest_supported_k8s_version(): | ||
k8s_versions = [ | ||
"1.21.7", | ||
"1.21.9", | ||
"1.22.4", | ||
"1.22.6", | ||
"1.23.3", | ||
"1.23.5", | ||
"1.24.0", | ||
] | ||
actual = filter_by_highest_supported_k8s_version(k8s_versions) | ||
expected = sorted(list(set(k8s_versions) - {"1.24.0"})) | ||
assert actual == expected |