Skip to content

Commit 5a59ffa

Browse files
committed
restore getstatus original code
1 parent 2d1c36b commit 5a59ffa

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

internal/orchestrator/helpers.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,17 @@ func getAppStatus(
169169
docker command.Cli,
170170
app app.ArduinoApp,
171171
) (AppStatusInfo, error) {
172-
statusInfo, err := getAppStatusByPath(ctx, docker.Client(), app.FullPath.String())
173-
172+
apps, err := getAppsStatus(ctx, docker.Client())
174173
if err != nil {
175174
return AppStatusInfo{}, fmt.Errorf("failed to get app status: %w", err)
176175
}
177-
return *statusInfo, nil
176+
idx := slices.IndexFunc(apps, func(a AppStatusInfo) bool {
177+
return a.AppPath.String() == app.FullPath.String()
178+
})
179+
if idx == -1 {
180+
return AppStatusInfo{}, fmt.Errorf("app %s not found", app.FullPath)
181+
}
182+
return apps[idx], nil
178183
}
179184

180185
func getRunningApp(

0 commit comments

Comments
 (0)