Skip to content

Kubernetes Python Client to return "Terminating" for terminating pods #2425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions .readthedocs.yaml

This file was deleted.

34 changes: 0 additions & 34 deletions devel/debug_logging.md

This file was deleted.

61 changes: 0 additions & 61 deletions examples/enable_debug_logging.py

This file was deleted.

9 changes: 8 additions & 1 deletion kubernetes/client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,14 @@ def deserialize(self, response, response_type):
except ValueError:
data = response.data

return self.__deserialize(data, response_type)
result = self.__deserialize(data, response_type)
if response_type == "V1PodList":
for pod in result.items:
if pod.metadata and pod.metadata.deletion_timestamp:
pod.status.phase = "Terminating"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be more of a request to change the upstream API behavior. You may want to check with upstream Kubernetes on the behavior here.

IIUC you're expecting the pod status to be marked Terminating if the deletion timestamp is set. What did you see before this change?

Also this is generated code, so we should not change it directly.


print(result)
return result

def __deserialize(self, data, klass):
"""Deserializes dict, list, str into an object.
Expand Down