From 613d3ca5b14fb17f8de8526523c7ba19f5b1129f Mon Sep 17 00:00:00 2001 From: Greg Jones Date: Fri, 10 Jan 2020 11:25:22 +0100 Subject: [PATCH] Update endpoints for Deployment Change from the deprecated extensions/v1beta1/Deployment endpoint, which will be removed by default in kubernetes 1.16, to apps/v1/Deployment, which is available since kubernetes 1.9 Relates to fiaas/fiaas-deploy-daemon#39 --- k8s/models/deployment.py | 4 ++-- tests/k8s/test_deployer.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/k8s/models/deployment.py b/k8s/models/deployment.py index 96b078f..1e49777 100644 --- a/k8s/models/deployment.py +++ b/k8s/models/deployment.py @@ -59,8 +59,8 @@ class DeploymentStatus(Model): class Deployment(Model): class Meta: - list_url = "/apis/extensions/v1beta1/deployments" - url_template = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + list_url = "/apis/apps/v1/deployments" + url_template = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" metadata = Field(ObjectMeta) spec = Field(DeploymentSpec) diff --git a/tests/k8s/test_deployer.py b/tests/k8s/test_deployer.py index c1b27a8..6f603a9 100644 --- a/tests/k8s/test_deployer.py +++ b/tests/k8s/test_deployer.py @@ -182,4 +182,4 @@ def _create_mock_response(): def _uri(namespace, name=""): - return "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}".format(name=name, namespace=namespace) + return "/apis/apps/v1/namespaces/{namespace}/deployments/{name}".format(name=name, namespace=namespace)