MCPcopy Index your code
hub / github.com/docker/docker-agent / Run

Function Run

pkg/selfupdate/selfupdate.go:143–148  ·  view source on GitHub ↗

Run attempts a self-update. It never returns an error: on success it re-executes the new binary (and does not return on Unix); on any failure or when already up to date it returns so the caller can continue with the current binary. Progress and failures are reported to stderr and slog. When a newer

(ctx context.Context, stdin io.Reader, stderr io.Writer)

Source from the content-addressed store, hash-verified

141// When a newer release is available and the session is interactive, the user
142// is prompted to confirm the upgrade; non-interactive sessions auto-confirm.
143func Run(ctx context.Context, stdin io.Reader, stderr io.Writer) {
144 if !Enabled() {
145 return
146 }
147 New(currentVersion()).run(ctx, stdin, stderr)
148}
149
150// run is the testable core. It logs and swallows every error.
151func (u *Updater) run(ctx context.Context, stdin io.Reader, stderr io.Writer) {

Callers 1

ExecuteFunction · 0.92

Calls 4

EnabledFunction · 0.85
currentVersionFunction · 0.85
NewFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected