MCPcopy
hub / github.com/cortexlabs/cortex / StreamDockerLogs

Function StreamDockerLogs

pkg/lib/docker/docker.go:207–227  ·  view source on GitHub ↗
(containerID string, containerIDs ...string)

Source from the content-addressed store, hash-verified

205}
206
207func StreamDockerLogs(containerID string, containerIDs ...string) error {
208 containerIDs = append([]string{containerID}, containerIDs...)
209
210 dockerClient, err := GetDockerClient()
211 if err != nil {
212 return err
213 }
214
215 fns := make([]func() error, len(containerIDs))
216 for i, containerID := range containerIDs {
217 fns[i] = StreamDockerLogsFn(containerID, dockerClient)
218 }
219
220 err = parallel.RunFirstErr(fns[0], fns[1:]...)
221
222 if err != nil {
223 return WrapDockerError(err)
224 }
225
226 return nil
227}
228
229func StreamDockerLogsFn(containerID string, dockerClient *Client) func() error {
230 return func() error {

Callers

nothing calls this directly

Calls 4

RunFirstErrFunction · 0.92
GetDockerClientFunction · 0.85
StreamDockerLogsFnFunction · 0.85
WrapDockerErrorFunction · 0.85

Tested by

no test coverage detected