Skip to content

Commit

Permalink
chore(dependency_checker): only inform about missing versions
Browse files Browse the repository at this point in the history
  • Loading branch information
swiatekm committed Nov 8, 2023
1 parent ca28f7b commit 7360119
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 38 deletions.
15 changes: 12 additions & 3 deletions ci/check_dependencies/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ def get_info(platform, officially_supported):
else:
line_pattern = "K8s with {}".format(platform)

now_suppported = kubernetes_collection.get_supported_versions(line_pattern)
versions_to_add = sorted(set(officially_supported) - set(now_suppported))
versions_to_remove = sorted(set(now_suppported) - set(officially_supported))

if len(versions_to_add) == 0 and len(versions_to_remove) == 0:
return

print(f"")
print(f"#### {platform} ####")
print("{} officially supported versions".format(platform))
print(officially_supported)

Expand All @@ -56,16 +65,16 @@ def get_info(platform, officially_supported):
platform
)
)
now_suppported = kubernetes_collection.get_supported_versions(line_pattern)

print(now_suppported)
print("\n")

versions_to_add = sorted(set(officially_supported) - set(now_suppported))

if len(versions_to_add) != 0:
print("Please add support to following {} versions:".format(platform))
print(versions_to_add)

versions_to_remove = sorted(set(now_suppported) - set(officially_supported))

if len(versions_to_remove) != 0:
print("Please remove support to following {} versions:".format(platform))
print(versions_to_remove)
30 changes: 4 additions & 26 deletions ci/check_dependencies/kops.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import json
import kubernetes_collection
import common

kops_line_pattern = "K8s with Kops"

Expand Down Expand Up @@ -46,30 +47,7 @@ def get_expected_supported_kops(kops_releases):


def get_info():
print("kOps latest versions from https://github.com/kubernetes/kops/releases")
# Figure out which versions we need to add/remove
kops_minor_releases = get_minor_releases("kubernetes", "kops")
print(kops_minor_releases)

print(
"Currently supported kOps versions for Sumologic Kubernetes Collection Helm Chart"
)
kops_now_suppported = kubernetes_collection.get_supported_versions(
kops_line_pattern
)
print(kops_now_suppported)

print(
"Expected supported kOps versions for Sumologic Kubernetes Collection Helm Chart"
)
kops_expected_supported = get_expected_supported_kops(kops_minor_releases)
print(kops_expected_supported)

versions_to_add = sorted(set(kops_expected_supported) - set(kops_now_suppported))
if len(versions_to_add) != 0:
print("\nPlease add support to following kOps versions:")
print(versions_to_add)

versions_to_remove = sorted(set(kops_now_suppported) - set(kops_expected_supported))
if len(versions_to_remove) != 0:
print("Please remove support to following kOps versions:")
print(versions_to_remove)
officially_supported = get_expected_supported_kops(kops_minor_releases)
common.get_info("Kops", officially_supported)
9 changes: 0 additions & 9 deletions ci/check_dependencies/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,10 @@
if __name__ == "__main__":
print("Gardener helper")
print("#####################################################################\n")
print("#### kOps ####")
kops.get_info()
print("")
print("#### EKS ####")
eks.get_info()
print("")
print("#### GKE ####")
gke.get_info()
print("")
print("#### AKS ####")
aks.get_info()
print("")
print("#### OpenShift ####")
openshift.get_info()
print("")

Expand Down

0 comments on commit 7360119

Please sign in to comment.