MCPcopy Index your code
hub / github.com/docker/docker-agent / toolsetStateBucket

Function toolsetStateBucket

pkg/runtime/runtime.go:913–922  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

911// not-yet-started toolset) is stopped; everything else (Ready, Degraded,
912// Starting, Restarting) reads as started/serving.
913func 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

Callers 1

toolsetDetailsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected