MCPcopy Create free account
hub / github.com/docker/docker-agent / withFallback

Method withFallback

pkg/remote/pull.go:235–245  ·  view source on GitHub ↗

withFallback runs op against the current puller and, if an anonymous request is denied or rate-limited, rebuilds the puller with keychain credentials and retries once. Subsequent calls reuse the credentialed puller (and its cached token).

(op func(*remote.Puller) error)

Source from the content-addressed store, hash-verified

233// retries once. Subsequent calls reuse the credentialed puller (and its cached
234// token).
235func (s *session) withFallback(op func(*remote.Puller) error) error {
236 err := op(s.puller)
237 if s.fellBack || !shouldRetryWithCredentials(err) {
238 return err
239 }
240
241 if err := s.retryWithCredentials(); err != nil {
242 return err
243 }
244 return op(s.puller)
245}
246
247func (s *session) retryWithCredentials() error {
248 if s.fellBack {

Callers 2

digestMethod · 0.95
getMethod · 0.95

Calls 2

retryWithCredentialsMethod · 0.95

Tested by

no test coverage detected