diff --git a/kubetest/objects/daemonset.py b/kubetest/objects/daemonset.py index fa9e372..4591a62 100644 --- a/kubetest/objects/daemonset.py +++ b/kubetest/objects/daemonset.py @@ -32,8 +32,6 @@ class DaemonSet(ApiObject): api_clients = { "preferred": client.AppsV1Api, "apps/v1": client.AppsV1Api, - "apps/v1beta1": client.AppsV1beta1Api, - "apps/v1beta2": client.AppsV1beta2Api, } def __init__(self, *args, **kwargs) -> None: diff --git a/kubetest/objects/deployment.py b/kubetest/objects/deployment.py index fbc006b..e80ca38 100644 --- a/kubetest/objects/deployment.py +++ b/kubetest/objects/deployment.py @@ -32,8 +32,6 @@ class Deployment(ApiObject): api_clients = { "preferred": client.AppsV1Api, "apps/v1": client.AppsV1Api, - "apps/v1beta1": client.AppsV1beta1Api, - "apps/v1beta2": client.AppsV1beta2Api, } def __init__(self, *args, **kwargs) -> None: diff --git a/kubetest/objects/ingress.py b/kubetest/objects/ingress.py index 0fb5582..bcfc448 100644 --- a/kubetest/objects/ingress.py +++ b/kubetest/objects/ingress.py @@ -24,11 +24,11 @@ class Ingress(ApiObject): https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#ingress-v1beta1-extensions """ - obj_type = client.ExtensionsV1beta1Api + obj_type = client.NetworkingV1beta1Api api_clients = { - "preferred": client.ExtensionsV1beta1Api, - "extensions/v1beta1": client.ExtensionsV1beta1Api, + "preferred": client.NetworkingV1beta1Api, + "networking.k8s.io/v1beta1": client.NetworkingV1beta1Api, } def __str__(self): diff --git a/kubetest/objects/replicaset.py b/kubetest/objects/replicaset.py index 95298a3..d0fc332 100644 --- a/kubetest/objects/replicaset.py +++ b/kubetest/objects/replicaset.py @@ -32,7 +32,6 @@ class ReplicaSet(ApiObject): api_clients = { "preferred": client.AppsV1Api, "apps/v1": client.AppsV1Api, - "apps/v1beta2": client.AppsV1beta2Api, } def __init__(self, *args, **kwargs) -> None: diff --git a/kubetest/objects/statefulset.py b/kubetest/objects/statefulset.py index 1f3ebb2..a72e851 100644 --- a/kubetest/objects/statefulset.py +++ b/kubetest/objects/statefulset.py @@ -32,8 +32,6 @@ class StatefulSet(ApiObject): api_clients = { "preferred": client.AppsV1Api, "apps/v1": client.AppsV1Api, - "apps/v1beta1": client.AppsV1beta1Api, - "apps/v1beta2": client.AppsV1beta2Api, } def __init__(self, *args, **kwargs) -> None: diff --git a/requirements-test.txt b/requirements-test.txt index a7b28b7..b396546 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,8 +1,8 @@ -# -# This file is autogenerated by pip-compile -# To update, run: -# -# pip-compile --output-file=requirements-test.txt test-requirements.in -# -coverage==5.5 - # via -r test-requirements.in +# +# This file is autogenerated by pip-compile with python 3.7 +# To update, run: +# +# pip-compile --output-file=requirements-test.txt test-requirements.in +# +coverage==6.0.2 + # via -r test-requirements.in diff --git a/requirements.txt b/requirements.txt index 308c803..eb22357 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,81 +1,83 @@ -# -# This file is autogenerated by pip-compile -# To update, run: -# -# pip-compile --output-file=requirements.txt setup.py -# -attrs==20.3.0 - # via pytest -cachetools==4.2.1 - # via google-auth -certifi==2020.12.5 +# +# This file is autogenerated by pip-compile with python 3.7 +# To update, run: +# +# pip-compile --output-file=requirements.txt setup.py +# +atomicwrites==1.4.0 + # via pytest +attrs==21.2.0 + # via pytest +cachetools==4.2.4 + # via google-auth +certifi==2021.10.8 # via # kubernetes - # requests -chardet==4.0.0 - # via requests -google-auth==1.28.0 - # via kubernetes -idna==2.10 - # via requests -importlib-metadata==3.7.3 + # requests +charset-normalizer==2.0.7 + # via requests +colorama==0.4.4 + # via pytest +google-auth==2.3.0 + # via kubernetes +idna==3.3 + # via requests +importlib-metadata==4.8.1 # via # pluggy - # pytest + # pytest iniconfig==1.1.1 - # via pytest -kubernetes==12.0.1 - # via kubetest (setup.py) -oauthlib==3.1.0 - # via requests-oauthlib -packaging==20.9 - # via pytest -pluggy==0.13.1 - # via pytest + # via pytest +kubernetes==18.20.0 + # via kubetest (setup.py) +oauthlib==3.1.1 + # via requests-oauthlib +packaging==21.0 + # via pytest +pluggy==1.0.0 + # via pytest py==1.10.0 - # via pytest -pyasn1-modules==0.2.8 - # via google-auth + # via pytest pyasn1==0.4.8 # via # pyasn1-modules - # rsa + # rsa +pyasn1-modules==0.2.8 + # via google-auth pyparsing==2.4.7 - # via packaging -pytest==6.2.2 - # via kubetest (setup.py) -python-dateutil==2.8.1 - # via kubernetes -pyyaml==5.4.1 + # via packaging +pytest==6.2.5 + # via kubetest (setup.py) +python-dateutil==2.8.2 + # via kubernetes +pyyaml==6.0 # via # kubernetes - # kubetest (setup.py) -requests-oauthlib==1.3.0 - # via kubernetes -requests==2.25.1 + # kubetest (setup.py) +requests==2.26.0 # via # kubernetes - # requests-oauthlib + # requests-oauthlib +requests-oauthlib==1.3.0 + # via kubernetes rsa==4.7.2 - # via google-auth -six==1.15.0 + # via google-auth +six==1.16.0 # via - # google-auth # kubernetes - # python-dateutil - # websocket-client + # python-dateutil toml==0.10.2 - # via pytest -typing-extensions==3.7.4.3 - # via importlib-metadata -urllib3==1.26.4 + # via pytest +typing-extensions==3.10.0.2 + # via importlib-metadata +urllib3==1.26.7 # via # kubernetes - # requests -websocket-client==0.58.0 - # via kubernetes -zipp==3.4.1 - # via importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -# setuptools + # requests +websocket-client==1.2.1 + # via kubernetes +zipp==3.6.0 + # via importlib-metadata + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/tests/conftest.py b/tests/conftest.py index b5ca69f..c78d4ca 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -123,17 +123,18 @@ def simple_persistentvolumeclaim(): @pytest.fixture() def simple_ingress(): """Return the Kubernetes config matching the simple-ingress.yaml manifest.""" - return client.ExtensionsV1beta1Ingress( - api_version="extensions/v1beta1", + return client.NetworkingV1beta1Ingress( + api_version="networking.k8s.io/v1beta1", kind="Ingress", metadata=client.V1ObjectMeta(name="my-ingress"), - spec=client.ExtensionsV1beta1IngressSpec( + spec=client.NetworkingV1beta1IngressSpec( rules=[ - client.ExtensionsV1beta1IngressRule( - http=client.ExtensionsV1beta1HTTPIngressRuleValue( + client.NetworkingV1beta1IngressRule( + host='my-host.com', + http=client.NetworkingV1beta1HTTPIngressRuleValue( paths=[ - client.ExtensionsV1beta1HTTPIngressPath( - backend=client.ExtensionsV1beta1IngressBackend( + client.NetworkingV1beta1HTTPIngressPath( + backend=client.NetworkingV1beta1IngressBackend( service_name="my-service", service_port=80 ), path="/", diff --git a/tests/data/manifests/deployment.yaml b/tests/data/manifests/deployment.yaml index 6be0f97..f7f95de 100644 --- a/tests/data/manifests/deployment.yaml +++ b/tests/data/manifests/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1beta2 +apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment diff --git a/tests/data/simple-ingress.yaml b/tests/data/simple-ingress.yaml index ea5f2a1..787684f 100644 --- a/tests/data/simple-ingress.yaml +++ b/tests/data/simple-ingress.yaml @@ -1,10 +1,10 @@ -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: my-ingress spec: rules: - - host: + - host: my-host.com http: paths: - path: / diff --git a/tests/test_manifest.py b/tests/test_manifest.py index ce92538..f085edc 100644 --- a/tests/test_manifest.py +++ b/tests/test_manifest.py @@ -154,7 +154,7 @@ def test_simple_service_wrong_type(self, manifest_dir): def test_simple_ingress_ok(self, manifest_dir, simple_ingress): """Test loading the simple service successfully.""" obj = manifest.load_type( - client.ExtensionsV1beta1Ingress, + client.NetworkingV1beta1Ingress, os.path.join(manifest_dir, "simple-ingress.yaml"), ) assert obj == simple_ingress @@ -254,18 +254,6 @@ class TestGetType: ({"apiVersion": "v1", "kind": "Secret"}, client.V1Secret), ({"apiVersion": "v1", "kind": "Deployment"}, client.V1Deployment), ({"apiVersion": "apps/v1", "kind": "Deployment"}, client.V1Deployment), - ( - {"apiVersion": "apps/v1beta1", "kind": "Deployment"}, - client.AppsV1beta1Deployment, - ), - ( - {"apiVersion": "apps/v1beta2", "kind": "Deployment"}, - client.V1beta2Deployment, - ), - ( - {"apiVersion": "extensions/v1beta1", "kind": "Deployment"}, - client.ExtensionsV1beta1Deployment, - ), ( { "apiVersion": "rbac.authorization.k8s.io/v1",