Skip to content

Commit 849e402

Browse files
committed
handle ct state in helpers
1 parent 906154a commit 849e402

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

internal/orchestrator/helpers.go

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"context"
2020
"errors"
2121
"fmt"
22-
"log/slog"
2322
"slices"
2423
"strings"
2524

@@ -50,12 +49,11 @@ type containerState struct {
5049
// For app that have at least 1 dependency, we calculate the overall state
5150
// as follow:
5251
//
53-
// running: all running
54-
// stopped: all stopped
55-
// failed: at least one failed
56-
// stopping: at least one stopping
57-
// stopped: at least one stopped
58-
// starting: at least one starting
52+
// running: all running
53+
// stopped: all stopped
54+
// failed: at least one failed
55+
// stopping: at least one stopping
56+
// starting: at least one starting
5957
func parseAppStatus(containers []container.Summary) []AppStatusInfo {
6058
apps := make([]AppStatusInfo, 0, len(containers))
6159
appsStatusMap := make(map[string][]containerState)
@@ -68,12 +66,6 @@ func parseAppStatus(containers []container.Summary) []AppStatusInfo {
6866
Status: StatusFromDockerState(c.State),
6967
StatusMessage: c.Status,
7068
})
71-
slog.Debug("Container status",
72-
slog.String("appPath", appPath),
73-
slog.String("containerID", c.ID),
74-
slog.String("state", string(c.State)),
75-
slog.String("statusMessage", c.Status),
76-
)
7769
}
7870

7971
appendResult := func(appPath *paths.Path, status Status) {

internal/orchestrator/helpers_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ func TestParseAppStatus(t *testing.T) {
6464
containerState: []container.ContainerState{container.StateRestarting, container.StateExited},
6565
want: StatusStarting,
6666
},
67-
{
68-
name: "failed",
69-
containerState: []container.ContainerState{container.StateRestarting, container.StateExited},
70-
want: StatusFailed,
71-
},
7267
}
7368

7469
for _, tc := range tests {

0 commit comments

Comments
 (0)