You get pods as returned by the Kubernetes API (kubectl get pods -o json → items). Report every pod
that is unhealthy, with the reasons, sorted by namespace/name:
"phase:<Phase>" when status.phase is not Running or Succeeded"not-ready:<container>" for each container in a Running pod whose ready is false"restarts:<container>=<n>" for each container with restartCount > max_restarts"waiting:<container>=<reason>" for each container whose state.waiting.reason is setReasons are listed in the order above, containers in their listed order. Return
[{"pod": "ns/name", "reasons": [...]}]; healthy pods are omitted.
Implement unhealthy_pods. Input: pods: list[dict], max_restarts: int. Returns: list[dict].
def unhealthy_pods(pods: list[dict], max_restarts: int) -> list[dict]:
return []
Run executes the public tests. Submit grades against public and hidden tests.
You get pods as returned by the Kubernetes API (kubectl get pods -o json → items). Report every pod
that is unhealthy, with the reasons, sorted by namespace/name:
"phase:<Phase>" when status.phase is not Running or Succeeded"not-ready:<container>" for each container in a Running pod whose ready is false"restarts:<container>=<n>" for each container with restartCount > max_restarts"waiting:<container>=<reason>" for each container whose state.waiting.reason is setReasons are listed in the order above, containers in their listed order. Return
[{"pod": "ns/name", "reasons": [...]}]; healthy pods are omitted.
Implement unhealthy_pods. Input: pods: list[dict], max_restarts: int. Returns: list[dict].
def unhealthy_pods(pods: list[dict], max_restarts: int) -> list[dict]:
return []
Run executes the public tests. Submit grades against public and hidden tests.