Skip to content

Commit

Permalink
Merge pull request #145 from minrk/completed-is-stopped
Browse files Browse the repository at this point in the history
poll returns exitcode if notebook container stops
  • Loading branch information
yuvipanda committed Mar 15, 2018
2 parents 1a784d8 + ca9ebb6 commit 2fc303e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kubespawner/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,8 +975,15 @@ def poll(self):
yield self.pod_reflector.first_load_future
data = self.pod_reflector.pods.get(self.pod_name, None)
if data is not None:
for c in data.status.container_statuses:
# return exit code if notebook container has terminated
if c.name == 'notebook':
if c.state.terminated:
return c.state.terminated.exit_code
break
# None means pod is running or starting up
return None

# pod doesn't exist or has been deleted
return 1

@run_on_executor
Expand Down

0 comments on commit 2fc303e

Please sign in to comment.