Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20.10 backport] Go 1.20 Enablement #46696

Merged
merged 8 commits into from
Oct 23, 2023

Conversation

corhere
Copy link
Contributor

@corhere corhere commented Oct 20, 2023

(Partial) backports of the following to 20.10:

The cherry-picks all applied cleanly enough, so might as well keep linting happy on the 20.10 branch.

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Roman Volosatovs and others added 8 commits October 20, 2023 19:01
Discovered a few instances, where loop variable is incorrectly used
within a test closure, which is marked as parallel.
Few of these were actually loops over singleton slices, therefore the issue
might not have surfaced there (yet), but it is good to fix there as
well, as this is an incorrect pattern used across different tests.

Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
(cherry picked from commit dd01abf)
Signed-off-by: Cory Snider <csnider@mirantis.com>
`/containers/<name>/copy` endpoint was deprecated in 1.8 and errors
since 1.12. See moby#22149 for more info.

Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
(cherry picked from commit a34d804)
Signed-off-by: Cory Snider <csnider@mirantis.com>
This test runs with t.Parallel() _and_ uses subtests, but didn't capture
the `tc` variable, which potentialy (likely) makes it test the same testcase
multiple times.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0c88740)
Signed-off-by: Cory Snider <csnider@mirantis.com>
"archive/tar".TypeRegA
  - The deprecated constant tar.TypeRegA is the same value as
    tar.TypeReg and so is not needed at all.

Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit dea3f2b)
Signed-off-by: Cory Snider <csnider@mirantis.com>
...flagged by golangci-lint v1.51.1 (staticcheck).

Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit e66995d)
Signed-off-by: Cory Snider <csnider@mirantis.com>
...which were flagged by golangci-lint v1.51.

Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit 0c68b65)
Signed-off-by: Cory Snider <csnider@mirantis.com>
(cherry picked from commit ca712d6)
Signed-off-by: Cory Snider <csnider@mirantis.com>
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 (9792191)
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>
(cherry picked from commit 938ed9a)
Signed-off-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: Cory Snider <csnider@mirantis.com>
@corhere corhere force-pushed the backport-20.10/go1.20-enablement branch from 77b343b to 79d5066 Compare October 20, 2023 23:01
@corhere corhere merged commit cb47414 into moby:20.10 Oct 23, 2023
1 of 2 checks passed
@corhere corhere deleted the backport-20.10/go1.20-enablement branch October 23, 2023 20:36
Copy link
Member

@samuelkarp samuelkarp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants