Skip to content

Instantly share code, notes, and snippets.

@chartjes
Created November 28, 2018 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chartjes/bf5f4334cbb57f591fae4c7a97c2c02e to your computer and use it in GitHub Desktop.
Save chartjes/bf5f4334cbb57f591fae4c7a97c2c02e to your computer and use it in GitHub Desktop.
def terminated_iter(v1):
for item in v1.list_pod_for_all_namespaces(watch=False).items:
for container in item.status.container_statuses:
terminated = container.state.terminated
if isinstance(terminated, client.V1ContainerStateTerminated):
yield terminated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment