Skip to content

Commit

Permalink
Merge pull request #67 from karellen/new_testing_environments
Browse files Browse the repository at this point in the history
Update Ktor for K8S 1.30/1.31
  • Loading branch information
arcivanov authored Sep 13, 2024
2 parents 7439dde + 7aa31a8 commit 319c82e
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/kubernator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# - os: macos-12
# python-version: '3.11'
env:
DEPLOY_PYTHONS: "3.11"
DEPLOY_PYTHONS: "3.12"
DEPLOY_OSES: "Linux"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TWINE_USERNAME: __token__
Expand Down Expand Up @@ -68,11 +68,11 @@ jobs:
set -x
brew update
brew install docker colima
colima version
colima start --cpu 3 --memory 8 --disk 7
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
while ! docker info > /dev/null 2>&1; do sleep 1 ; done
docker info
Expand Down
2 changes: 1 addition & 1 deletion .idea/kubernator.iml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim-bookworm
FROM python:3.12-slim-bookworm

COPY target/dist/kubernator*/dist/*.whl /tmp

Expand Down
3 changes: 2 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
@init
def set_properties(project):
project.depends_on("gevent", ">=21.1.2")
project.depends_on("kubernetes", "~=29.0")
project.depends_on("kubernetes", "~=30.0")
project.depends_on("durationpy", ">=0.7")
project.depends_on("openapi-schema-validator", "~=0.1")
project.depends_on("openapi-spec-validator", "~=0.3")
project.depends_on("json-log-formatter", "~=0.3")
Expand Down
2 changes: 1 addition & 1 deletion src/integrationtest/python/full_smoke_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_full_smoke(self):
test_dir = Path(__file__).parent / "full_smoke"

for k8s_version, istio_version in ((self.K8S_TEST_VERSIONS[0], "1.10.6"),
(self.K8S_TEST_VERSIONS[-1], "1.22.0")):
(self.K8S_TEST_VERSIONS[-1], "1.23.1")):
with self.subTest(k8s_version=k8s_version, istio_version=istio_version):
os.environ["K8S_VERSION"] = k8s_version
os.environ["ISTIO_VERSION"] = istio_version
Expand Down
2 changes: 1 addition & 1 deletion src/integrationtest/python/issue_23_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_issue_23(self):
test_dir = Path(__file__).parent / "issue_23"

for k8s_version, istio_version in ((self.K8S_TEST_VERSIONS[0], "1.10.6"),
(self.K8S_TEST_VERSIONS[-1], "1.22.0")):
(self.K8S_TEST_VERSIONS[-1], "1.23.1")):
with self.subTest(k8s_version=k8s_version, istio_version=istio_version):
os.environ["K8S_VERSION"] = k8s_version
os.environ["ISTIO_VERSION"] = istio_version
Expand Down
4 changes: 2 additions & 2 deletions src/integrationtest/python/test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
class IntegrationTestSupport(unittest.TestCase):
K8S_TEST_VERSIONS = ["1.20.15", "1.21.14", "1.22.17",
"1.23.17", "1.24.17", "1.25.16",
"1.26.15", "1.27.14", "1.28.10",
"1.29.5", "1.30.1"]
"1.26.15", "1.27.16", "1.28.13",
"1.29.8", "1.30.4", "1.31.1"]

def load_json_logs(self, log_file):
decoder = json.JSONDecoder()
Expand Down
7 changes: 4 additions & 3 deletions src/main/python/kubernator/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@

import requests
import yaml
from platformdirs import user_cache_dir
from diff_match_patch import diff_match_patch
from jinja2 import (Environment,
ChainableUndefined,
make_logging_undefined,
Template as JinjaTemplate,
pass_context)
from jsonschema import validators
from platformdirs import user_cache_dir

from kubernator._json_path import jp # noqa: F401
from kubernator._k8s_client_patches import (URLLIB_HEADERS_PATCH,
Expand Down Expand Up @@ -765,9 +765,10 @@ def install_python_k8s_client(run, package_major, logger, logger_stdout, logger_

if not package_major_dir.exists():
package_major_dir.mkdir(parents=True, exist_ok=True)
run([sys.executable, "-m", "pip", "install", "--no-deps", "--no-input", "--pre",
run([sys.executable, "-m", "pip", "install", "--no-deps", "--no-input",
"--root-user-action=ignore", "--break-system-packages", "--disable-pip-version-check",
"--target", package_major_dir_str, f"kubernetes~={package_major}.0"], logger_stdout, logger_stderr).wait()
"--target", package_major_dir_str, f"kubernetes>={package_major!s}dev0,<{int(package_major) + 1!s}"],
logger_stdout, logger_stderr).wait()

if not patch_indicator.exists() and not disable_patching:
for patch_text, target_file, skip_if_found, min_version, max_version, name in (
Expand Down

0 comments on commit 319c82e

Please sign in to comment.