openshiftpods: fix delete_namespaced_pod arguments

This change prevents a TypeError when deleting pods:
  TypeError: delete_namespaced_pod() takes 3 positional arguments but 4 were given

Change-Id: I6d31af352e3151eb1bdef52472a4b0b5fa00ecd8
This commit is contained in:
Tristan Cacqueray 2021-06-15 16:41:34 +00:00
parent 8ee837670e
commit 028a26319e
2 changed files with 2 additions and 8 deletions

View File

@ -119,14 +119,8 @@ class OpenshiftPodsProvider(OpenshiftProvider):
self.log.exception("%s: unknown pool" % server_id) self.log.exception("%s: unknown pool" % server_id)
return return
self.log.debug("%s: removing pod" % pod_name) self.log.debug("%s: removing pod" % pod_name)
delete_body = {
"apiVersion": "v1",
"kind": "DeleteOptions",
"propagationPolicy": "Background"
}
try: try:
self.k8s_client.delete_namespaced_pod( self.k8s_client.delete_namespaced_pod(pod_name, project_name)
pod_name, project_name, delete_body)
self.log.info("%s: pod removed" % server_id) self.log.info("%s: pod removed" % server_id)
except Exception: except Exception:
# TODO: implement better exception handling # TODO: implement better exception handling

View File

@ -57,7 +57,7 @@ class FakeCoreClient(object):
phase = "Running" phase = "Running"
return FakePod return FakePod
def delete_namespaced_pod(self, name, project, delete_body): def delete_namespaced_pod(self, name, project):
to_delete = None to_delete = None
for pod in self.pods: for pod in self.pods:
if pod.metadata.name == name: if pod.metadata.name == name: