moby/distribution
Cory Snider 938ed9a1ed distribution/xfer: make off-by-one error a feature
maxDownloadAttempts maps to the daemon configuration flag

    --max-download-attempts int
      Set the max download attempts for each pull (default 5)

and the daemon configuration machinery interprets a value of 0 as "apply
the default value" and not a valid user value (config validation/
normalization bugs notwithstanding). The intention is clearly that this
configuration value should be an upper limit on the number of times the
daemon should try to download a particular layer before giving up. So it
is surprising to have the configuration value interpreted as a _retry_
limit. The daemon will make up to N+1 attempts to download a layer! This
also means users cannot disable retries even if they wanted to.

As this is a longstanding bug, not a recent regression, it would not be
appropriate to backport the fix (97921915a8)
in a patch release. Update the test to assert on the buggy behaviour so
it passes again.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-02-22 12:34:59 -05:00
..
fixtures/validate_manifest Add distribution package 2015-11-24 09:40:24 -08:00
metadata Remove uses of deprecated go-digest.NewDigestFromHex, go-digest.Digest.Hex 2022-12-09 00:17:18 +01:00
utils Add canonical import comment 2018-02-05 16:51:57 -05:00
xfer distribution/xfer: make off-by-one error a feature 2023-02-22 12:34:59 -05:00
config.go distribution: remove unused RequireSchema2 2022-12-03 18:09:17 +01:00
errors.go distribution: Error when pulling OCI artifacts 2022-11-03 19:41:51 +01:00
errors_test.go distribution: un-export internal errors and error-utilities 2022-04-21 22:53:02 +02:00
manifest.go Validate digest in repo for pull by digest 2022-10-21 01:50:09 +02:00
manifest_test.go Validate digest in repo for pull by digest 2022-10-21 01:50:09 +02:00
pull.go distribution: move newPusher() and newPuller() together with definition 2022-04-21 23:13:39 +02:00
pull_v2.go distribution: remove unused RequireSchema2 2022-12-03 18:09:17 +01:00
pull_v2_test.go fix some minor linting issues 2022-07-04 10:15:28 +02:00
pull_v2_unix.go Remove long-deprecated "arm" fallback 2022-11-05 18:23:43 +01:00
pull_v2_windows.go distribution: remove Puller interface, remove redundant V1 checks 2022-04-21 23:11:07 +02:00
push.go distribution: move newPusher() and newPuller() together with definition 2022-04-21 23:13:39 +02:00
push_v2.go distribution: remove unused RequireSchema2 2022-12-03 18:09:17 +01:00
push_v2_test.go distribution: remove Pusher interface, NewPusher(), and redundant V1 checks 2022-04-21 23:11:54 +02:00
registry.go distribution: checkSupportedMediaType: allow additional media-types 2022-12-02 01:31:51 +01:00
registry_unit_test.go distribution: add GetRepository(), un-export NewV2Repository, ValidateRepoName 2022-04-21 23:12:02 +02:00
repository.go distribution: add GetRepository(), un-export NewV2Repository, ValidateRepoName 2022-04-21 23:12:02 +02:00