MCPcopy Index your code
hub / github.com/docker/cli / WaitOnService

Function WaitOnService

cli/command/service/helpers.go:14–32  ·  view source on GitHub ↗

WaitOnService waits for the service to converge. It outputs a progress bar, if appropriate based on the CLI flags.

(ctx context.Context, dockerCli command.Cli, serviceID string, quiet bool)

Source from the content-addressed store, hash-verified

12// WaitOnService waits for the service to converge. It outputs a progress bar,
13// if appropriate based on the CLI flags.
14func WaitOnService(ctx context.Context, dockerCli command.Cli, serviceID string, quiet bool) error {
15 errChan := make(chan error, 1)
16 pipeReader, pipeWriter := io.Pipe()
17
18 go func() {
19 errChan <- progress.ServiceProgress(ctx, dockerCli.Client(), serviceID, pipeWriter)
20 }()
21
22 if quiet {
23 go io.Copy(io.Discard, pipeReader)
24 return <-errChan
25 }
26
27 err := jsonstream.Display(ctx, pipeReader, dockerCli.Out())
28 if err == nil {
29 err = <-errChan
30 }
31 return err
32}

Callers 4

runUpdateFunction · 0.85
runScaleFunction · 0.85
runCreateFunction · 0.85
runRollbackFunction · 0.85

Calls 2

ClientMethod · 0.65
OutMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…