diff --git a/backend/btrixcloud/k8sapi.py b/backend/btrixcloud/k8sapi.py index 73663934e..2014961b7 100644 --- a/backend/btrixcloud/k8sapi.py +++ b/backend/btrixcloud/k8sapi.py @@ -216,13 +216,7 @@ async def get_profile_browser(self, browserid): ) async def _patch_job(self, crawl_id, body, pluraltype="crawljobs") -> dict: - content_type = self.api_client.default_headers.get("Content-Type") - try: - self.api_client.set_default_header( - "Content-Type", "application/merge-patch+json" - ) - await self.custom_api.patch_namespaced_custom_object( group="btrix.cloud", version="v1", @@ -230,6 +224,7 @@ async def _patch_job(self, crawl_id, body, pluraltype="crawljobs") -> dict: plural=pluraltype, name=f"{pluraltype[:-1]}-{crawl_id}", body={"spec": body}, + _content_type="application/merge-patch+json", ) return {"success": True} # pylint: disable=broad-except @@ -237,12 +232,6 @@ async def _patch_job(self, crawl_id, body, pluraltype="crawljobs") -> dict: traceback.print_exc() return {"error": str(exc)} - finally: - if content_type: - self.api_client.set_default_header("Content-Type", content_type) - else: - del self.api_client.default_headers["Content-Type"] - async def print_pod_logs(self, pod_names, lines=100): """print pod logs""" for pod in pod_names: diff --git a/backend/requirements.txt b/backend/requirements.txt index 0877636c9..f8204b211 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -9,7 +9,7 @@ email-validator #fastapi-users[mongodb]==9.2.2 loguru aiofiles -kubernetes-asyncio==25.11.0 +kubernetes-asyncio==29.0.0 kubernetes aiobotocore redis>=5.0.0