toolsetStateBucket collapses the lifecycle state machine into the inspector's three buckets. Failed is the only error state; Stopped (including a not-yet-started toolset) is stopped; everything else (Ready, Degraded, Starting, Restarting) reads as started/serving.
(s lifecycle.State)
| 911 | // not-yet-started toolset) is stopped; everything else (Ready, Degraded, |
| 912 | // Starting, Restarting) reads as started/serving. |
| 913 | func toolsetStateBucket(s lifecycle.State) ToolsetState { |
| 914 | switch s { |
| 915 | case lifecycle.StateFailed: |
| 916 | return ToolsetError |
| 917 | case lifecycle.StateStopped: |
| 918 | return ToolsetStopped |
| 919 | default: |
| 920 | return ToolsetStarted |
| 921 | } |
| 922 | } |
| 923 | |
| 924 | // startedToolNames returns the live tool names of ts, but only when it is a |
| 925 | // started toolset; the boolean is false for not-yet-started toolsets so the |