MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / container_ready_condition

Function container_ready_condition

crates/openshell-driver-docker/src/lib.rs:2814–2857  ·  view source on GitHub ↗
(
    state: ContainerSummaryStateEnum,
    supervisor_connected: bool,
)

Source from the content-addressed store, hash-verified

2812}
2813
2814fn container_ready_condition(
2815 state: ContainerSummaryStateEnum,
2816 supervisor_connected: bool,
2817) -> (&'static str, &'static str, &'static str, bool) {
2818 match state {
2819 ContainerSummaryStateEnum::RUNNING => {
2820 if supervisor_connected {
2821 (
2822 "True",
2823 "SupervisorConnected",
2824 "Supervisor relay is live",
2825 false,
2826 )
2827 } else {
2828 (
2829 "False",
2830 "DependenciesNotReady",
2831 "Container is running; waiting for supervisor relay",
2832 false,
2833 )
2834 }
2835 }
2836 ContainerSummaryStateEnum::CREATED => ("False", "Starting", "Container created", false),
2837 ContainerSummaryStateEnum::RESTARTING => (
2838 "False",
2839 "ContainerRestarting",
2840 "Container is restarting after a failure",
2841 false,
2842 ),
2843 ContainerSummaryStateEnum::EMPTY => {
2844 ("False", "Starting", "Container state is unknown", false)
2845 }
2846 ContainerSummaryStateEnum::REMOVING => {
2847 ("False", "Deleting", "Container is being removed", true)
2848 }
2849 ContainerSummaryStateEnum::PAUSED => {
2850 ("False", "ContainerPaused", "Container is paused", false)
2851 }
2852 ContainerSummaryStateEnum::EXITED => {
2853 ("False", "ContainerExited", "Container exited", false)
2854 }
2855 ContainerSummaryStateEnum::DEAD => ("False", "ContainerDead", "Container is dead", false),
2856 }
2857}
2858
2859fn summary_container_name(summary: &ContainerSummary) -> Option<String> {
2860 summary

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected