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

[27.x backport] fix non-constant format string (caught by go1.24) #49204

Merged
merged 3 commits into from
Jan 3, 2025

Conversation

thaJeztah
Copy link
Member


Not exactly sure why our linters didn't spot this, as it did for Linux; #48359 - perhaps we're missing some GOOS=windows in our linter?

Ultimately we should also remove these libnetwork-specific errors, and just use errdefs probably.

distribution: fix non-constant format string

caught by go1.24

# github.com/docker/docker/distribution
# github.com/docker/docker/distribution/pull_v2_windows.go:145:35: non-constant format string in call to (*github.com/docker/docker/vendor/github.com/sirupsen/logrus.Entry).Debugf
FAIL    github.com/docker/docker/distribution [build failed]

libnetwork/drivers/windows: fix non-constant format string

Also updated some existing ones to use %v instead of %s for consistency.

caught by go1.24

# github.com/docker/docker/libnetwork/drivers/windows/overlay
# github.com/docker/docker/libnetwork/drivers/windows/overlay/ov_network_windows.go:206:32: non-constant format string in call to github.com/docker/docker/libnetwork/types.ForbiddenErrorf
FAIL    github.com/docker/docker/libnetwork/drivers/windows/overlay [build failed]

# github.com/docker/docker/libnetwork/drivers/windows
# github.com/docker/docker/libnetwork/drivers/windows/windows.go:449:33: non-constant format string in call to github.com/docker/docker/libnetwork/types.ForbiddenErrorf
FAIL    github.com/docker/docker/libnetwork/drivers/windows [build failed]

- Description for the changelog

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

caught by go1.24

    # github.com/docker/docker/distribution
    # github.com/docker/docker/distribution/pull_v2_windows.go:145:35: non-constant format string in call to (*github.com/docker/docker/vendor/github.com/sirupsen/logrus.Entry).Debugf
    FAIL    github.com/docker/docker/distribution [build failed]

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8c96e45)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Also updated some existing ones to use `%v` instead of `%s` for consistency.

caught by go1.24

    # github.com/docker/docker/libnetwork/drivers/windows/overlay
    # github.com/docker/docker/libnetwork/drivers/windows/overlay/ov_network_windows.go:206:32: non-constant format string in call to github.com/docker/docker/libnetwork/types.ForbiddenErrorf
    FAIL    github.com/docker/docker/libnetwork/drivers/windows/overlay [build failed]

    # github.com/docker/docker/libnetwork/drivers/windows
    # github.com/docker/docker/libnetwork/drivers/windows/windows.go:449:33: non-constant format string in call to github.com/docker/docker/libnetwork/types.ForbiddenErrorf
    FAIL    github.com/docker/docker/libnetwork/drivers/windows [build failed]

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3b8ba71)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1f4c9f2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the 27.5.0 milestone Jan 2, 2025
@thaJeztah thaJeztah self-assigned this Jan 2, 2025
@thaJeztah thaJeztah merged commit dcedefd into moby:27.x Jan 3, 2025
138 checks passed
@thaJeztah thaJeztah deleted the 27.x_backport_non_const_formatting branch January 3, 2025 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants