mirror of
https://github.com/moby/moby.git
synced 2026-01-17 02:41:41 +00:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bea959c7b7 | ||
|
|
3e9ff78b94 | ||
|
|
29ed80aa86 | ||
|
|
da489a11d4 | ||
|
|
f173e45ae9 | ||
|
|
e4b1f89996 | ||
|
|
0c9e14dcce | ||
|
|
bf6d688157 | ||
|
|
4205776b85 | ||
|
|
e77ff99ede | ||
|
|
6e3cf7f12b | ||
|
|
38c0abffce | ||
|
|
3b7d703484 | ||
|
|
d14a60fe24 | ||
|
|
da65c869b5 | ||
|
|
76fbfe9953 | ||
|
|
bfade89ec2 | ||
|
|
a818cfd87b | ||
|
|
653777a522 | ||
|
|
1ad3df4768 | ||
|
|
6323db8e78 | ||
|
|
a3c8f7fa8c | ||
|
|
dfbba63a34 | ||
|
|
5beb93de84 | ||
|
|
e17e96e3c5 | ||
|
|
e0183475e0 | ||
|
|
a2af8bdebd |
2
.github/workflows/.test-unit.yml
vendored
2
.github/workflows/.test-unit.yml
vendored
@@ -16,7 +16,7 @@ on:
|
||||
workflow_call:
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.24.4"
|
||||
GO_VERSION: "1.24.5"
|
||||
GOTESTLIST_VERSION: v0.3.1
|
||||
TESTSTAT_VERSION: v0.1.25
|
||||
SETUP_BUILDX_VERSION: edge
|
||||
|
||||
2
.github/workflows/.test.yml
vendored
2
.github/workflows/.test.yml
vendored
@@ -21,7 +21,7 @@ on:
|
||||
default: "graphdriver"
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.24.4"
|
||||
GO_VERSION: "1.24.5"
|
||||
GOTESTLIST_VERSION: v0.3.1
|
||||
TESTSTAT_VERSION: v0.1.25
|
||||
ITG_CLI_MATRIX_SIZE: 6
|
||||
|
||||
18
.github/workflows/.windows.yml
vendored
18
.github/workflows/.windows.yml
vendored
@@ -28,12 +28,12 @@ on:
|
||||
default: false
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.24.4"
|
||||
GO_VERSION: "1.24.5"
|
||||
GOTESTLIST_VERSION: v0.3.1
|
||||
TESTSTAT_VERSION: v0.1.25
|
||||
WINDOWS_BASE_IMAGE: mcr.microsoft.com/windows/servercore
|
||||
WINDOWS_BASE_TAG_2019: ltsc2019
|
||||
WINDOWS_BASE_TAG_2022: ltsc2022
|
||||
WINDOWS_BASE_TAG_2025: ltsc2025
|
||||
TEST_IMAGE_NAME: moby:test
|
||||
TEST_CTN_NAME: moby
|
||||
DOCKER_BUILDKIT: 0
|
||||
@@ -65,8 +65,8 @@ jobs:
|
||||
run: |
|
||||
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
|
||||
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go\pkg\mod"
|
||||
If ("${{ inputs.os }}" -eq "windows-2019") {
|
||||
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
||||
If ("${{ inputs.os }}" -eq "windows-2025") {
|
||||
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2025 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
||||
} ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
|
||||
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
||||
}
|
||||
@@ -92,7 +92,6 @@ jobs:
|
||||
& docker build `
|
||||
--build-arg WINDOWS_BASE_IMAGE `
|
||||
--build-arg WINDOWS_BASE_IMAGE_TAG `
|
||||
--build-arg GO_VERSION `
|
||||
-t ${{ env.TEST_IMAGE_NAME }} `
|
||||
-f Dockerfile.windows .
|
||||
-
|
||||
@@ -145,8 +144,8 @@ jobs:
|
||||
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
|
||||
New-Item -ItemType "directory" -Path "${{ github.workspace }}\go\pkg\mod"
|
||||
New-Item -ItemType "directory" -Path "bundles"
|
||||
If ("${{ inputs.os }}" -eq "windows-2019") {
|
||||
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
||||
If ("${{ inputs.os }}" -eq "windows-2025") {
|
||||
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2025 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
||||
} ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
|
||||
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
||||
}
|
||||
@@ -172,7 +171,6 @@ jobs:
|
||||
& docker build `
|
||||
--build-arg WINDOWS_BASE_IMAGE `
|
||||
--build-arg WINDOWS_BASE_IMAGE_TAG `
|
||||
--build-arg GO_VERSION `
|
||||
-t ${{ env.TEST_IMAGE_NAME }} `
|
||||
-f Dockerfile.windows .
|
||||
-
|
||||
@@ -321,8 +319,8 @@ jobs:
|
||||
name: Init
|
||||
run: |
|
||||
New-Item -ItemType "directory" -Path "bundles"
|
||||
If ("${{ inputs.os }}" -eq "windows-2019") {
|
||||
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
||||
If ("${{ inputs.os }}" -eq "windows-2025") {
|
||||
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2025 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
||||
} ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
|
||||
echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
||||
}
|
||||
|
||||
2
.github/workflows/arm64.yml
vendored
2
.github/workflows/arm64.yml
vendored
@@ -23,7 +23,7 @@ on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.24.4"
|
||||
GO_VERSION: "1.24.5"
|
||||
TESTSTAT_VERSION: v0.1.25
|
||||
DESTDIR: ./build
|
||||
SETUP_BUILDX_VERSION: edge
|
||||
|
||||
2
.github/workflows/bin-image.yml
vendored
2
.github/workflows/bin-image.yml
vendored
@@ -69,6 +69,8 @@ jobs:
|
||||
type=semver,pattern={{version}}
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{major}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
-
|
||||
name: Rename meta bake definition file
|
||||
# see https://github.com/docker/metadata-action/issues/381#issuecomment-1918607161
|
||||
|
||||
3
.github/workflows/buildkit.yml
vendored
3
.github/workflows/buildkit.yml
vendored
@@ -23,7 +23,7 @@ on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.24.4"
|
||||
GO_VERSION: "1.24.5"
|
||||
DESTDIR: ./build
|
||||
SETUP_BUILDX_VERSION: edge
|
||||
SETUP_BUILDKIT_IMAGE: moby/buildkit:latest
|
||||
@@ -220,7 +220,6 @@ jobs:
|
||||
& docker build `
|
||||
--build-arg WINDOWS_BASE_IMAGE `
|
||||
--build-arg WINDOWS_BASE_IMAGE_TAG `
|
||||
--build-arg GO_VERSION `
|
||||
-t ${{ env.TEST_IMAGE_NAME }} `
|
||||
-f Dockerfile.windows .
|
||||
|
||||
|
||||
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@@ -58,7 +58,7 @@ jobs:
|
||||
- name: Update Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.24.4"
|
||||
go-version: "1.24.5"
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -23,7 +23,7 @@ on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.24.4"
|
||||
GO_VERSION: "1.24.5"
|
||||
GIT_PAGER: "cat"
|
||||
PAGER: "cat"
|
||||
SETUP_BUILDX_VERSION: edge
|
||||
|
||||
8
.github/workflows/windows-2022.yml
vendored
8
.github/workflows/windows-2022.yml
vendored
@@ -14,13 +14,9 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 10 * * *'
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- '[0-9]+.[0-9]+'
|
||||
- '[0-9]+.x'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
validate-dco:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: windows-2019
|
||||
name: windows-2025
|
||||
|
||||
# Default to 'contents: read', which grants actions to read commits.
|
||||
#
|
||||
@@ -14,9 +14,13 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 10 * * *'
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- '[0-9]+.[0-9]+'
|
||||
- '[0-9]+.x'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
validate-dco:
|
||||
@@ -37,6 +41,6 @@ jobs:
|
||||
matrix:
|
||||
storage: ${{ fromJson(needs.test-prepare.outputs.matrix) }}
|
||||
with:
|
||||
os: windows-2019
|
||||
os: windows-2025
|
||||
storage: ${{ matrix.storage }}
|
||||
send_coverage: false
|
||||
@@ -3,7 +3,7 @@ version: "2"
|
||||
run:
|
||||
# prevent golangci-lint from deducting the go version to lint for through go.mod,
|
||||
# which causes it to fallback to go1.17 semantics.
|
||||
go: "1.24.4"
|
||||
go: "1.24.5"
|
||||
concurrency: 2
|
||||
# Only supported with go modules enabled (build flag -mod=vendor only valid when using modules)
|
||||
# modules-download-mode: vendor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG GO_VERSION=1.24.4
|
||||
ARG GO_VERSION=1.24.5
|
||||
ARG BASE_DEBIAN_DISTRO="bookworm"
|
||||
ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"
|
||||
ARG XX_VERSION=1.6.1
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
# This represents the bare minimum required to build and test Docker.
|
||||
|
||||
ARG GO_VERSION=1.24.4
|
||||
ARG GO_VERSION=1.24.5
|
||||
|
||||
ARG BASE_DEBIAN_DISTRO="bookworm"
|
||||
ARG GOLANG_IMAGE="golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO}"
|
||||
|
||||
@@ -161,7 +161,7 @@ FROM ${WINDOWS_BASE_IMAGE}:${WINDOWS_BASE_IMAGE_TAG}
|
||||
# Use PowerShell as the default shell
|
||||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
|
||||
|
||||
ARG GO_VERSION=1.24.4
|
||||
ARG GO_VERSION=1.24.5
|
||||
ARG GOTESTSUM_VERSION=v1.12.0
|
||||
|
||||
# GOWINRES_VERSION is the version of go-winres to install.
|
||||
|
||||
@@ -100,6 +100,8 @@ func (ir *imageRouter) postImagesCreate(ctx context.Context, w http.ResponseWrit
|
||||
|
||||
// For a pull it is not an error if no auth was given. Ignore invalid
|
||||
// AuthConfig to increase compatibility with the existing API.
|
||||
//
|
||||
// TODO(thaJeztah): accept empty values but return an error when failing to decode.
|
||||
authConfig, _ := registry.DecodeAuthConfig(r.Header.Get(registry.AuthHeader))
|
||||
progressErr = ir.backend.PullImage(ctx, ref, platform, metaHeaders, authConfig, output)
|
||||
} else { // import
|
||||
@@ -167,16 +169,11 @@ func (ir *imageRouter) postImagesPush(ctx context.Context, w http.ResponseWriter
|
||||
|
||||
var authConfig *registry.AuthConfig
|
||||
if authEncoded := r.Header.Get(registry.AuthHeader); authEncoded != "" {
|
||||
// the new format is to handle the authConfig as a header. Ignore invalid
|
||||
// AuthConfig to increase compatibility with the existing API.
|
||||
// Handle the authConfig as a header, but ignore invalid AuthConfig
|
||||
// to increase compatibility with the existing API.
|
||||
//
|
||||
// TODO(thaJeztah): accept empty values but return an error when failing to decode.
|
||||
authConfig, _ = registry.DecodeAuthConfig(authEncoded)
|
||||
} else {
|
||||
// the old format is supported for compatibility if there was no authConfig header
|
||||
var err error
|
||||
authConfig, err = registry.DecodeAuthConfigBody(r.Body)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "bad parameters and missing X-Registry-Auth")
|
||||
}
|
||||
}
|
||||
|
||||
output := ioutils.NewWriteFlusher(w)
|
||||
|
||||
@@ -2913,7 +2913,8 @@ definitions:
|
||||
be used. If multiple endpoints have the same priority, endpoints are
|
||||
lexicographically sorted based on their network name, and the one
|
||||
that sorts first is picked.
|
||||
type: "number"
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
example:
|
||||
- 10
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ func DecodeAuthConfig(authEncoded string) (*AuthConfig, error) {
|
||||
// Like [DecodeAuthConfig], this function always returns an [AuthConfig], even if an
|
||||
// error occurs. It is up to the caller to decide if authentication is required,
|
||||
// and if the error can be ignored.
|
||||
//
|
||||
// Deprecated: this function is no longer used and will be removed in the next release.
|
||||
func DecodeAuthConfigBody(rdr io.ReadCloser) (*AuthConfig, error) {
|
||||
return decodeAuthConfigFromReader(rdr)
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package registry
|
||||
|
||||
import (
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gotest.tools/v3/assert"
|
||||
@@ -47,12 +45,6 @@ func TestDecodeAuthConfig(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestDecodeAuthConfigBody(t *testing.T) {
|
||||
token, err := DecodeAuthConfigBody(io.NopCloser(strings.NewReader(unencoded)))
|
||||
assert.NilError(t, err)
|
||||
assert.Equal(t, *token, expected)
|
||||
}
|
||||
|
||||
func TestEncodeAuthConfig(t *testing.T) {
|
||||
token, err := EncodeAuthConfig(expected)
|
||||
assert.NilError(t, err)
|
||||
|
||||
@@ -66,7 +66,16 @@ func (cli *Client) ImagePush(ctx context.Context, image string, options image.Pu
|
||||
}
|
||||
|
||||
func (cli *Client) tryImagePush(ctx context.Context, imageID string, query url.Values, registryAuth string) (*http.Response, error) {
|
||||
return cli.post(ctx, "/images/"+imageID+"/push", query, nil, http.Header{
|
||||
// Always send a body (which may be an empty JSON document ("{}")) to prevent
|
||||
// EOF errors on older daemons which had faulty fallback code for handling
|
||||
// authentication in the body when no auth-header was set, resulting in;
|
||||
//
|
||||
// Error response from daemon: bad parameters and missing X-Registry-Auth: invalid X-Registry-Auth header: EOF
|
||||
//
|
||||
// We use [http.NoBody], which gets marshaled to an empty JSON document.
|
||||
//
|
||||
// see: https://github.com/moby/moby/commit/ea29dffaa541289591aa44fa85d2a596ce860e16
|
||||
return cli.post(ctx, "/images/"+imageID+"/push", query, http.NoBody, http.Header{
|
||||
registry.AuthHeader: {registryAuth},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3039,7 +3039,8 @@ definitions:
|
||||
be used. If multiple endpoints have the same priority, endpoints are
|
||||
lexicographically sorted based on their network name, and the one
|
||||
that sorts first is picked.
|
||||
type: "number"
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
example:
|
||||
- 10
|
||||
|
||||
|
||||
@@ -3039,7 +3039,8 @@ definitions:
|
||||
be used. If multiple endpoints have the same priority, endpoints are
|
||||
lexicographically sorted based on their network name, and the one
|
||||
that sorts first is picked.
|
||||
type: "number"
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
example:
|
||||
- 10
|
||||
|
||||
|
||||
@@ -2914,7 +2914,8 @@ definitions:
|
||||
be used. If multiple endpoints have the same priority, endpoints are
|
||||
lexicographically sorted based on their network name, and the one
|
||||
that sorts first is picked.
|
||||
type: "number"
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
example:
|
||||
- 10
|
||||
|
||||
|
||||
@@ -2913,7 +2913,8 @@ definitions:
|
||||
be used. If multiple endpoints have the same priority, endpoints are
|
||||
lexicographically sorted based on their network name, and the one
|
||||
that sorts first is picked.
|
||||
type: "number"
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
example:
|
||||
- 10
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@ if [[ "${buildkit_ref}" == *-*-* ]]; then
|
||||
buildkit_ref=$(curl -s "https://api.github.com/repos/${buildkit_repo}/commits/${buildkit_ref}" | jq -r .sha)
|
||||
fi
|
||||
|
||||
# FIXME(thaJeztah) temporarily overriding version to use for tests; remove with the next release of buildkit; see https://github.com/moby/moby/issues/50389
|
||||
buildkit_ref=dd2b4e18663c58ac3762d7b60b2c3301f71d5fa9
|
||||
|
||||
cat << EOF
|
||||
BUILDKIT_REPO=$buildkit_repo
|
||||
BUILDKIT_REF=$buildkit_ref
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG GO_VERSION=1.24.4
|
||||
ARG GO_VERSION=1.24.5
|
||||
ARG BASE_DEBIAN_DISTRO="bookworm"
|
||||
ARG PROTOC_VERSION=3.11.4
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG GO_VERSION=1.24.4
|
||||
ARG GOVULNCHECK_VERSION=v1.1.3
|
||||
ARG GO_VERSION=1.24.5
|
||||
ARG GOVULNCHECK_VERSION=v1.1.4
|
||||
ARG FORMAT=text
|
||||
|
||||
FROM golang:${GO_VERSION}-alpine AS base
|
||||
@@ -20,12 +20,6 @@ RUN --mount=type=bind,target=.,rw <<EOT
|
||||
ln -s vendor.mod go.mod
|
||||
ln -s vendor.sum go.sum
|
||||
govulncheck -format ${FORMAT} ./... | tee /out/govulncheck.out
|
||||
if [ "${FORMAT}" = "sarif" ]; then
|
||||
# Make sure "results" field is defined in SARIF output otherwise GitHub Code Scanning
|
||||
# will fail when uploading report with "Invalid SARIF. Missing 'results' array in run."
|
||||
# Relates to https://github.com/golang/vuln/blob/ffdef74cc44d7eb71931d8d414c478b966812488/internal/sarif/sarif.go#L69
|
||||
jq '(.runs[] | select(.results == null) | .results) |= []' /out/govulncheck.out | tee >(sponge /out/govulncheck.out)
|
||||
fi
|
||||
EOT
|
||||
|
||||
FROM scratch AS output
|
||||
|
||||
@@ -185,6 +185,8 @@ func TestBridgeICC(t *testing.T) {
|
||||
Force: true,
|
||||
})
|
||||
|
||||
networking.FirewalldReload(t, d)
|
||||
|
||||
pingHost := tc.pingHost
|
||||
if pingHost == "" {
|
||||
if tc.isLinkLocal {
|
||||
@@ -319,6 +321,7 @@ func TestBridgeINC(t *testing.T) {
|
||||
defer c.ContainerRemove(ctx, id1, containertypes.RemoveOptions{
|
||||
Force: true,
|
||||
})
|
||||
networking.FirewalldReload(t, d)
|
||||
|
||||
ctr1Info := container.Inspect(ctx, t, c, id1)
|
||||
targetAddr := ctr1Info.NetworkSettings.Networks[bridge1].IPAddress
|
||||
@@ -457,6 +460,7 @@ func TestBridgeINCRouted(t *testing.T) {
|
||||
|
||||
for _, fwdPolicy := range []string{"ACCEPT", "DROP"} {
|
||||
networking.SetFilterForwardPolicies(t, firewallBackend, fwdPolicy)
|
||||
networking.FirewalldReload(t, d)
|
||||
t.Run(fwdPolicy, func(t *testing.T) {
|
||||
for _, tc := range testcases {
|
||||
t.Run(tc.name+"/v4/ping", func(t *testing.T) {
|
||||
@@ -574,6 +578,8 @@ func TestRoutedAccessToPublishedPort(t *testing.T) {
|
||||
)
|
||||
defer network.RemoveNoError(ctx, t, c, routedNetName)
|
||||
|
||||
networking.FirewalldReload(t, d)
|
||||
|
||||
// With docker-proxy disabled, a container can't normally access a port published
|
||||
// from a container in a different bridge network. But, users can add rules to
|
||||
// the DOCKER-USER chain to get around that limitation of docker's iptables rules.
|
||||
@@ -823,6 +829,7 @@ func TestInternalNwConnectivity(t *testing.T) {
|
||||
container.WithNetworkMode(bridgeName),
|
||||
)
|
||||
defer c.ContainerRemove(ctx, id, containertypes.RemoveOptions{Force: true})
|
||||
networking.FirewalldReload(t, d)
|
||||
|
||||
execCtx, cancel := context.WithTimeout(ctx, 20*time.Second)
|
||||
defer cancel()
|
||||
@@ -1000,9 +1007,10 @@ func TestNoIP6Tables(t *testing.T) {
|
||||
ctx := setupTest(t)
|
||||
|
||||
testcases := []struct {
|
||||
name string
|
||||
option string
|
||||
expIPTables bool
|
||||
name string
|
||||
option string
|
||||
reloadFirewalld bool
|
||||
expIPTables bool
|
||||
}{
|
||||
{
|
||||
name: "ip6tables on",
|
||||
@@ -1013,10 +1021,18 @@ func TestNoIP6Tables(t *testing.T) {
|
||||
name: "ip6tables off",
|
||||
option: "--ip6tables=false",
|
||||
},
|
||||
{
|
||||
name: "ip6tables off with firewalld reload",
|
||||
option: "--ip6tables=false",
|
||||
reloadFirewalld: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testcases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
if tc.reloadFirewalld {
|
||||
skip.If(t, !networking.FirewalldRunning(), "firewalld is not running")
|
||||
}
|
||||
ctx := testutil.StartSpan(ctx, t)
|
||||
|
||||
d := daemon.New(t)
|
||||
@@ -1039,6 +1055,9 @@ func TestNoIP6Tables(t *testing.T) {
|
||||
id := container.Run(ctx, t, c, container.WithNetworkMode(netName))
|
||||
defer c.ContainerRemove(ctx, id, containertypes.RemoveOptions{Force: true})
|
||||
|
||||
if tc.reloadFirewalld {
|
||||
networking.FirewalldReload(t, d)
|
||||
}
|
||||
var cmd *exec.Cmd
|
||||
if d.FirewallBackendDriver(t) == "nftables" {
|
||||
cmd = exec.Command("nft", "list", "table", "ip6", "docker-bridges")
|
||||
|
||||
@@ -57,7 +57,7 @@ func TestNatNetworkICC(t *testing.T) {
|
||||
pingCmd := []string{"ping", "-n", "1", "-w", "3000", ctr1Name}
|
||||
|
||||
const ctr2Name = "ctr2"
|
||||
attachCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
attachCtx, cancel := context.WithTimeout(ctx, 15*time.Second)
|
||||
defer cancel()
|
||||
res := container.RunAttach(attachCtx, t, c,
|
||||
container.WithName(ctr2Name),
|
||||
@@ -105,9 +105,9 @@ func TestFlakyPortMappedHairpinWindows(t *testing.T) {
|
||||
inspect := container.Inspect(ctx, t, c, serverId)
|
||||
hostPort := inspect.NetworkSettings.Ports["80/tcp"][0].HostPort
|
||||
|
||||
clientCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
attachCtx, cancel := context.WithTimeout(ctx, 15*time.Second)
|
||||
defer cancel()
|
||||
res := container.RunAttach(clientCtx, t, c,
|
||||
res := container.RunAttach(attachCtx, t, c,
|
||||
container.WithNetworkMode(clientNetName),
|
||||
container.WithCmd("wget", "http://"+hostAddr+":"+hostPort),
|
||||
)
|
||||
|
||||
@@ -792,11 +792,20 @@ func releasePortBindings(pbs []portBinding, fwn firewaller.Network) error {
|
||||
func (n *bridgeNetwork) reapplyPerPortIptables() {
|
||||
n.Lock()
|
||||
var allPBs []portBinding
|
||||
var allEPs []*bridgeEndpoint
|
||||
for _, ep := range n.endpoints {
|
||||
allPBs = append(allPBs, ep.portMapping...)
|
||||
allEPs = append(allEPs, ep)
|
||||
}
|
||||
n.Unlock()
|
||||
|
||||
for _, ep := range allEPs {
|
||||
netip4, netip6 := ep.netipAddrs()
|
||||
if err := n.firewallerNetwork.AddEndpoint(context.TODO(), netip4, netip6); err != nil {
|
||||
log.G(context.TODO()).Warnf("Failed to reconfigure Endpoint: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := n.firewallerNetwork.AddPorts(context.Background(), mergeChildHostIPs(allPBs)); err != nil {
|
||||
log.G(context.TODO()).Warnf("Failed to reconfigure NAT: %s", err)
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ require (
|
||||
github.com/miekg/dns v1.1.66
|
||||
github.com/mistifyio/go-zfs/v3 v3.0.1
|
||||
github.com/mitchellh/copystructure v1.2.0
|
||||
github.com/moby/buildkit v0.23.1
|
||||
github.com/moby/buildkit v0.23.2 // FIXME(thaJeztah): remove override from hack/buildkit-ref when updating.
|
||||
github.com/moby/docker-image-spec v1.3.1
|
||||
github.com/moby/go-archive v0.1.0
|
||||
github.com/moby/ipvs v1.1.0
|
||||
@@ -209,7 +209,7 @@ require (
|
||||
github.com/tinylib/msgp v1.1.8 // indirect
|
||||
github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 // indirect
|
||||
github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f // indirect
|
||||
github.com/tonistiigi/go-actions-cache v0.0.0-20250611155157-388a2ec8cdf8 // indirect
|
||||
github.com/tonistiigi/go-actions-cache v0.0.0-20250626083717-378c5ed1ddd9 // indirect
|
||||
github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 // indirect
|
||||
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
|
||||
github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab // indirect
|
||||
|
||||
@@ -384,8 +384,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F
|
||||
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
|
||||
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
|
||||
github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b/go.mod h1:pzzDgJWZ34fGzaAZGFW22KVZDfyrYW+QABMrWnJBnSs=
|
||||
github.com/moby/buildkit v0.23.1 h1:CZtFmPRF+IFG1C8QfPnktGO1Dzzt5JSwtQ5eDqIh+ag=
|
||||
github.com/moby/buildkit v0.23.1/go.mod h1:keNXljNmKX1T0AtM0bMObc8OV6mA9cOuquVbPcRpU/Y=
|
||||
github.com/moby/buildkit v0.23.2 h1:gt/dkfcpgTXKx+B9I310kV767hhVqTvEyxGgI3mqsGQ=
|
||||
github.com/moby/buildkit v0.23.2/go.mod h1:iEjAfPQKIuO+8y6OcInInvzqTMiKMbb2RdJz1K/95a0=
|
||||
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
|
||||
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
|
||||
github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ=
|
||||
@@ -559,8 +559,8 @@ github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 h1:r0p7fK5
|
||||
github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323/go.mod h1:3Iuxbr0P7D3zUzBMAZB+ois3h/et0shEz0qApgHYGpY=
|
||||
github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f h1:MoxeMfHAe5Qj/ySSBfL8A7l1V+hxuluj8owsIEEZipI=
|
||||
github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f/go.mod h1:BKdcez7BiVtBvIcef90ZPc6ebqIWr4JWD7+EvLm6J98=
|
||||
github.com/tonistiigi/go-actions-cache v0.0.0-20250611155157-388a2ec8cdf8 h1:KbACff2cR+ip6/Kmt8zCzieMlKYyypArQT1ZweFxewQ=
|
||||
github.com/tonistiigi/go-actions-cache v0.0.0-20250611155157-388a2ec8cdf8/go.mod h1:gJlfrsY8U+1n9RGKSgWryNFfzHRl/b1a99RUVL1L4Qw=
|
||||
github.com/tonistiigi/go-actions-cache v0.0.0-20250626083717-378c5ed1ddd9 h1:GWuTlpuUQBaK6u0R3HwE+eWaQ2aXwHgo8CaXgqtDQZU=
|
||||
github.com/tonistiigi/go-actions-cache v0.0.0-20250626083717-378c5ed1ddd9/go.mod h1:cD0SB2270BYw6HYKriFn4H6NRLhGj6ytf48YTpsm8LY=
|
||||
github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0=
|
||||
github.com/tonistiigi/go-archvariant v1.0.0/go.mod h1:TxFmO5VS6vMq2kvs3ht04iPXtu2rUT/erOnGFYfk5Ho=
|
||||
github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 h1:2f304B10LaZdB8kkVEaoXvAMVan2tl9AiK4G0odjQtE=
|
||||
|
||||
4
vendor/github.com/moby/buildkit/exporter/local/fs.go
generated
vendored
4
vendor/github.com/moby/buildkit/exporter/local/fs.go
generated
vendored
@@ -180,7 +180,7 @@ func CreateFS(ctx context.Context, sessionID string, k string, ref cache.Immutab
|
||||
return nil, nil, err
|
||||
}
|
||||
stmtFS := staticfs.NewFS()
|
||||
split := opt.UsePlatformSplit(isMap)
|
||||
addPlatformToFilename := isMap && !opt.UsePlatformSplit(isMap)
|
||||
|
||||
names := map[string]struct{}{}
|
||||
for i, stmt := range stmts {
|
||||
@@ -190,7 +190,7 @@ func CreateFS(ctx context.Context, sessionID string, k string, ref cache.Immutab
|
||||
}
|
||||
|
||||
name := opt.AttestationPrefix + path.Base(attestations[i].Path)
|
||||
if !split {
|
||||
if addPlatformToFilename {
|
||||
nameExt := path.Ext(name)
|
||||
namBase := strings.TrimSuffix(name, nameExt)
|
||||
name = fmt.Sprintf("%s.%s%s", namBase, strings.ReplaceAll(k, "/", "_"), nameExt)
|
||||
|
||||
1
vendor/github.com/tonistiigi/go-actions-cache/cache.go
generated
vendored
1
vendor/github.com/tonistiigi/go-actions-cache/cache.go
generated
vendored
@@ -593,6 +593,7 @@ type Entry struct {
|
||||
IsAzureBlob bool `json:"isAzureBlob"`
|
||||
|
||||
client *http.Client
|
||||
reload func(context.Context) error
|
||||
}
|
||||
|
||||
func (ce *Entry) WriteTo(ctx context.Context, w io.Writer) error {
|
||||
|
||||
47
vendor/github.com/tonistiigi/go-actions-cache/cache_v2.go
generated
vendored
47
vendor/github.com/tonistiigi/go-actions-cache/cache_v2.go
generated
vendored
@@ -5,6 +5,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -76,17 +77,34 @@ func (c *Cache) uploadV2(ctx context.Context, url string, b Blob) error {
|
||||
|
||||
func (ce *Entry) downloadV2(ctx context.Context) ReaderAtCloser {
|
||||
return toReaderAtCloser(func(offset int64) (io.ReadCloser, error) {
|
||||
client, err := blockblob.NewClientWithNoCredential(ce.URL, azureOptions)
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
var retried bool
|
||||
for {
|
||||
client, err := blockblob.NewClientWithNoCredential(ce.URL, azureOptions)
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
resp, err := client.DownloadStream(ctx, &blob.DownloadStreamOptions{
|
||||
Range: blob.HTTPRange{Offset: offset},
|
||||
})
|
||||
if err != nil {
|
||||
if !retried {
|
||||
// the URL might have expired, so we try to load it again
|
||||
retried = true
|
||||
var respErr *azcore.ResponseError
|
||||
if errors.As(err, &respErr) {
|
||||
if respErr.StatusCode == http.StatusForbidden || respErr.StatusCode == http.StatusUnauthorized {
|
||||
Log("reload download URL because error %v", err)
|
||||
if err := ce.reload(ctx); err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
continue // retry with the new URL
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
return resp.Body, nil
|
||||
}
|
||||
resp, err := client.DownloadStream(ctx, &blob.DownloadStreamOptions{
|
||||
Range: blob.HTTPRange{Offset: offset},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
return resp.Body, nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -187,6 +205,15 @@ func (c *Cache) loadV2(ctx context.Context, keys ...string) (*Entry, error) {
|
||||
ce.URL = val.SignedDownloadURL
|
||||
ce.IsAzureBlob = true
|
||||
ce.client = c.opt.Client
|
||||
ce.reload = func(ctx context.Context) error {
|
||||
v, err := c.loadV2(ctx, keys...)
|
||||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
ce.URL = v.URL
|
||||
ce.Key = v.Key
|
||||
return nil
|
||||
}
|
||||
|
||||
return &ce, nil
|
||||
}
|
||||
|
||||
4
vendor/modules.txt
vendored
4
vendor/modules.txt
vendored
@@ -757,7 +757,7 @@ github.com/mitchellh/hashstructure/v2
|
||||
# github.com/mitchellh/reflectwalk v1.0.2
|
||||
## explicit
|
||||
github.com/mitchellh/reflectwalk
|
||||
# github.com/moby/buildkit v0.23.1
|
||||
# github.com/moby/buildkit v0.23.2
|
||||
## explicit; go 1.23.0
|
||||
github.com/moby/buildkit/api/services/control
|
||||
github.com/moby/buildkit/api/types
|
||||
@@ -1190,7 +1190,7 @@ github.com/tonistiigi/dchapes-mode
|
||||
github.com/tonistiigi/fsutil
|
||||
github.com/tonistiigi/fsutil/copy
|
||||
github.com/tonistiigi/fsutil/types
|
||||
# github.com/tonistiigi/go-actions-cache v0.0.0-20250611155157-388a2ec8cdf8
|
||||
# github.com/tonistiigi/go-actions-cache v0.0.0-20250626083717-378c5ed1ddd9
|
||||
## explicit; go 1.23.0
|
||||
github.com/tonistiigi/go-actions-cache
|
||||
# github.com/tonistiigi/go-archvariant v1.0.0
|
||||
|
||||
Reference in New Issue
Block a user