Skip to content

Commit

Permalink
fix: return waiting on no pvcviewer status (kubeflow#7350)
Browse files Browse the repository at this point in the history
In some cases, a PVCViewer object has no status as it was just created or is having issues starting a pod.  In those cases, we should rather return waiting than uninitialized, which would appear to the users as if no viewer was started.
  • Loading branch information
TobiasGoerke authored May 24, 2024
1 parent 1413631 commit 7011b6f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions components/crud-web-apps/volumes/backend/apps/common/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@ def viewer_status(viewer):
Return a string representing the status of that viewer. If a deletion
timestamp is set we want to return a `Terminating` state.
"""
try:
ready = viewer["status"]["ready"]
except KeyError:
if viewer is None or not viewer:
return status.STATUS_PHASE.UNINITIALIZED

if "deletionTimestamp" in viewer["metadata"]:
metadata = viewer.get("metadata", {})
if "deletionTimestamp" in metadata:
return status.STATUS_PHASE.TERMINATING

if not ready:
return status.STATUS_PHASE.WAITING
if viewer.get("status", {}).get("ready", False):
return status.STATUS_PHASE.READY

return status.STATUS_PHASE.READY
return status.STATUS_PHASE.WAITING

0 comments on commit 7011b6f

Please sign in to comment.