Skip to content

Commit

Permalink
fix: Remove cluster version upper limit and handle policy API release (
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeacom authored Feb 23, 2023
1 parent f63e8ed commit a7241dc
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 64 deletions.
2 changes: 1 addition & 1 deletion eksupgrade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"""

__version__: str = "0.5.1"
__version__: str = "0.6.0"
14 changes: 9 additions & 5 deletions eksupgrade/src/preflight_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
import urllib3
import yaml
from kubernetes import client

try:
from kubernetes.client import PolicyV1beta1Api as PolicyV1Api
except ImportError:
from kubernetes.client import PolicyV1Api

from kubernetes.client import *

from eksupgrade.utils import get_package_dict
Expand Down Expand Up @@ -93,9 +99,7 @@ def get_cluster_version(
customer_report["cluster upgradation"] = (
"Cluster already upgraded to version " + cluster_details["cluster"]["version"]
)
elif (round(float(update_version) - float(cluster_details["cluster"]["version"]), 2)) == 0.01 and float(
update_version
) < 1.25:
elif (round(float(update_version) - float(cluster_details["cluster"]["version"]), 2)) == 0.01:
logger.info(
"Cluster with version %s can be updated to target version %s",
cluster_details["cluster"]["version"],
Expand Down Expand Up @@ -261,7 +265,7 @@ def pod_security_policies(
"""Check for pod security policies."""
loading_config(cluster_name, region)
try:
policy_v1_api = client.PolicyV1beta1Api()
policy_v1_api = PolicyV1Api()
logger.info("Pod Security Policies .....")
ret = policy_v1_api.list_pod_security_policy(field_selector="metadata.name=eks.privileged")

Expand Down Expand Up @@ -700,7 +704,7 @@ def pod_disruption_budget(
loading_config(cluster_name, region)
logger.info("Fetching Pod Disruption Budget Details....")
try:
policy_v1_api = client.PolicyV1beta1Api()
policy_v1_api = PolicyV1Api()
ret = policy_v1_api.list_pod_disruption_budget_for_all_namespaces()
if not ret.items:
customer_report["pod disruption budget"] = "No Pod Disruption Budget exists in cluster"
Expand Down
112 changes: 56 additions & 56 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "eksupgrade"
version = "0.5.1"
version = "0.6.0"
description = "The Amazon EKS cluster upgrade utility"
authors = ["EKS Upgrade Maintainers <[email protected]>"]
readme = "README.md"
Expand Down Expand Up @@ -67,7 +67,7 @@ build = "poetry build"
[tool.poetry.dependencies]
python = "^3.8"
boto3 = "^1.26.71"
kubernetes = ">=21.0.0 <25.0.0"
kubernetes = ">=21.0.0 <26.0.0"


[tool.poetry.group.test.dependencies]
Expand Down

0 comments on commit a7241dc

Please sign in to comment.