Skip to content

Commit

Permalink
Merge pull request #148 from 2gis/dependencies
Browse files Browse the repository at this point in the history
Update dependencies and drop support for autoscaling/v2beta2, policy/v1beta1, batch/v1beta1
  • Loading branch information
seleznev committed Aug 21, 2023
2 parents a8106c8 + f5871f9 commit b714a2a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-alpine
FROM python:3.11-alpine

LABEL description="Image with k8s-handle" \
maintainer="sre@jetbrains.com" \
Expand Down
3 changes: 0 additions & 3 deletions k8s_handle/k8s/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@ class Adapter:
api_versions = {
'v1': client.CoreV1Api,
'batch/v1': client.BatchV1Api,
'batch/v1beta1': client.BatchV1beta1Api,
'policy/v1': client.PolicyV1Api,
'policy/v1beta1': client.PolicyV1beta1Api,
'storage.k8s.io/v1': client.StorageV1Api,
'apps/v1': client.AppsV1Api,
'autoscaling/v1': client.AutoscalingV1Api,
'autoscaling/v2': client.AutoscalingV2Api,
'autoscaling/v2beta2': client.AutoscalingV2beta2Api,
'rbac.authorization.k8s.io/v1': client.RbacAuthorizationV1Api,
'scheduling.k8s.io/v1': client.SchedulingV1Api,
'networking.k8s.io/v1': client.NetworkingV1Api,
Expand Down
6 changes: 3 additions & 3 deletions k8s_handle/k8s/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def to_dict(obj):
if val is not None:
result[v] = to_dict(val)
return result
elif type(obj) == list:
elif isinstance(obj, list):
return [to_dict(x) for x in obj]
elif type(obj) == datetime:
elif isinstance(obj, datetime):
return str(obj)
elif type(obj) == dict:
elif isinstance(obj, dict):
newobj = copy.deepcopy(obj)
for k, v in obj.items():
newobj[k] = to_dict(obj[k])
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
requests==2.28.1
requests==2.31.0
jinja2==3.1.2
PyYAML==5.4.1
kubernetes==24.2.0
semver==2.13.0
urllib3==1.26.13
PyYAML==6.0.1
kubernetes==27.2.0
semver==3.0.1
urllib3==1.26.16
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
skipsdist = True
envlist = py310
envlist = py311

[testenv]
deps = -r {toxinidir}/requirements.txt
Expand Down

0 comments on commit b714a2a

Please sign in to comment.