Commit Graph

50832 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
1fd9eb772f Merge pull request #48616 from dgunzy/47452-allow-empty-isolation-string
api: Allow for an empty string for Isolation in Swagger specs
2024-12-19 15:31:15 +01:00
Sebastiaan van Stijn
6f1580399e Merge pull request #49127 from thaJeztah/shaun_curator
add Shaun Thompson as curator
2024-12-19 14:54:38 +01:00
Sebastiaan van Stijn
4e3202affb Merge pull request #49125 from akerouanton/move-iptRule-to-ipt-pkg
libnet/d/bridge: move iptRule to iptables pkg
2024-12-19 13:50:42 +01:00
Paweł Gronowski
2dad06f981 Merge pull request #49106 from thaJeztah/ReplaceContainer_noshadow
libcontainer: ReplaceContainer: fix var shadowing import
2024-12-19 12:48:40 +00:00
Albin Kerouanton
f95e4b3d22 Merge pull request #49129 from thaJeztah/migrate_reexec
pkg/reexec: deprecate and migrate to github.com/moby/sys/reexec
2024-12-19 12:42:41 +01:00
Sebastiaan van Stijn
4f5ec9994c pkg/reexec: deprecate and migrate to github.com/moby/sys/reexec
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-19 10:12:58 +01:00
Sebastiaan van Stijn
40f58b3492 Merge pull request #49062 from dvdksn/builder-gcpolicy-empty-keepbytes
builder: fall back to defaultKeepStorage if keepStorage is unset for GC policy
2024-12-18 19:12:59 +01:00
Sebastiaan van Stijn
93101be4b7 Merge pull request #49128 from robmry/v6only/enable_ext_dns
Enable external DNS if a network has an IPv6 gateway
2024-12-18 16:24:06 +01:00
Sebastiaan van Stijn
7fbbd52b0e add Shaun Thompson as curator
Shaun is managing the runtime and build teams, and will be helping out
on triage, as well as organizing backlogs on GitHub.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-18 14:33:19 +01:00
Rob Murray
b0be1f3af8 Enable external DNS if a network has an IPv6 gateway
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-18 12:22:45 +00:00
Sebastiaan van Stijn
bdfc384352 Merge pull request #49123 from akerouanton/remove-dns-answers-from-otel-spans
[master forward-port] libnet: don't put external DNS answers in OTel spans
2024-12-18 12:30:05 +01:00
Albin Kerouanton
ec8a5b0f4c libnet/d/bridge: move iptRule to iptables pkg
This moves the iptRule struct from the bridge package to the iptables
pkg.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2024-12-18 11:01:27 +01:00
Albin Kerouanton
1b823fb54e libnet: don't put external DNS answers in OTel spans
When containers make DNS resolution, and the domain name they're trying
to resolve doesn't match any running container, the DNS query is
forwarded to upstream servers. In that case, when we receive a response,
we put it in an OTel spans.

This was useful to debug DNS resolution on GHA, but it leads to
excessive memory usage when DNS resolution happen in a tight loop. So,
keep the OTel event signaling that a response was received, but drop the
answer from the OTel span.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit 173a9f2091)
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2024-12-18 09:24:44 +01:00
Albin Kerouanton
ca85ba2e82 Merge pull request #49114 from thaJeztah/deprecate_BridgeNfIptables_fields
Deprecate BridgeNfIptables and BridgeNfIp6tables fields
2024-12-18 09:22:36 +01:00
Sebastiaan van Stijn
fab60e2c2c Merge pull request #49121 from thaJeztah/iptables_rm_deprecated
libnetwork/iptables: remove deprecated IPV, Iptables, IP6Tables, Passthrough()
2024-12-18 00:00:55 +01:00
Albin Kerouanton
0d53725a7f Merge pull request #49107 from akerouanton/ipt-split-ProgramChain
libnet/iptables: split ProgramChain and move to bridge driver
2024-12-17 19:15:52 +01:00
Sebastiaan van Stijn
b6594353f8 libnetwork/iptables: remove deprecated Passthrough()
This was deprecated in d688389f4a, and has
no known external users. The deprecation was included in the 27.4.1
release, so we can remove it from master.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-17 18:49:10 +01:00
Sebastiaan van Stijn
d34d092b42 libnetwork/iptables: remove deprecated IPV, Iptables, IP6Tables
This was deprecated in 27deff4da1, and has
no known external users. The deprecation was included in the 27.4.1
release, so we can remove it from master.

This patch removes the deprecated `IPV`, and `Iptables` and `IP6Tables`
consts.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-17 18:49:09 +01:00
Sebastiaan van Stijn
cc1d50a63d Merge pull request #49118 from thaJeztah/reexec_clean
pkg/reexec: some cleaning up in preparation of moving to a separate module
2024-12-17 17:07:05 +01:00
Rob Murray
f237ba0ea7 Merge pull request #48641 from robmry/iptables-combine-outgoing-and-icc-rules
Combine Outgoing and ICC=true iptables rules
2024-12-17 14:44:11 +00:00
Sebastiaan van Stijn
8d3ecc28c1 Merge pull request #49115 from thaJeztah/libnetwork_deprecate_Passthrough
libnetwork/iptables: deprecate Passthrough
2024-12-17 12:48:53 +01:00
Albin Kerouanton
820dea0d2b libnet/d/bridge: hardcode chain names
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2024-12-17 12:31:35 +01:00
Albin Kerouanton
bd30a51ea7 libnet/iptables: split ProgramChain and move to bridge driver
The `ProgramChain` method was called exclusively by the bridge driver
to insert totally unrelated ipt rules in two different table-chains.

Break down this method into two functions, and move them into the bridge
pkg.

The new function `addNATJumpRules` inserts rules that aren't related to
any specific network, and depends solely on the driver config. Call it
during driver configuration instead of during network setup.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2024-12-17 12:31:34 +01:00
Rob Murray
df3c78d061 Combine outgoing and ICC iptables rules
Rather than:

  ACCEPT -i <bridge> -o <bridge>   // icc=true
  ACCEPT -i <bridge> ! -o <bridge> // outgoing

Do:

  ACCEPT -i <bridge>  // icc=true and outgoing

For ICC=false, continue to do:

  DROP -i <bridge> -o <bridge>
  ACCEPT -i <bridge> ! -o <bridge>

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-17 10:38:09 +00:00
Rob Murray
0f259dd76d Rename setupIPTablesInternal -> setupNonInternalNetworkRules
setupIPTablesInternal is/was called from setupIPTables to set
up some rules for a network ... "internal" behaviour of the
outer function.

Then commit 7b64b1c2 added support for "--internal" bridge
networks, calling setupInternalNetworkRules from setupIPTables
instead of setupIPTablesInternal.

So, setupIPTablesInternal is the function that deals with
everything except "--internal" networks ... rename it.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-17 10:38:09 +00:00
Rob Murray
556b8eed16 Tidy setupIPTablesInternal
- Move variable declarations closer to where they're used.
- Put comments in the blocks they apply to.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-17 10:38:09 +00:00
Rob Murray
726b327b83 Merge pull request #48640 from robmry/iptables-static-forward-rules
Create static iptables rules during bridge driver init
2024-12-17 10:36:11 +00:00
Sebastiaan van Stijn
8fd177d79b pkg/reexec: Command: separate public API from implementation
Move the exported `Command` to a platform-agnostic file, and un-export
the platform-specific implementations. This allows us to maintain the
GoDoc in a single place, describing platform-specific differences where
needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-17 10:51:06 +01:00
Sebastiaan van Stijn
6568c06d12 pkg/reexec: make platform-agnostic (again)
The reexec package originally was platform-agnostic, but gained some
Linux-specific handling in 1cb17f03d0.

When Windows support was implemented in Docker, the pkg/reexec package
was adjusted accordingly in 64715c4f33,
which now made the package with with either Linux or Windows, with various
other platforms (freebsd, solaris, darwin) being added back in separate
changes.

Based on the history above, this package should be platform-agnostic, except
for Linux-specific changes introduced in 1cb17f03d0
and 5aee8807a6.

This patch:

- removes the stub-implementation to make it functional on other platforms.
- renames the files for consistency

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-17 10:51:06 +01:00
Sebastiaan van Stijn
7672d60033 pkg/reexec: use const for name of test binary
Also use a slightly different name, because "reexec" is used so
widely as term in this package, making it somewhat confusing.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-17 10:51:06 +01:00
Paweł Gronowski
0e8013d72d Merge pull request #49113 from thaJeztah/fix_version_history_typo
docs/api: version-history.md: fix markdown
2024-12-17 09:23:31 +00:00
Rob Murray
0ef2b24c80 Make libnetwork responsible for DOCKER-USER setup/reload
It no longer needs to be moved to the top of the filter-FORWARD
chain after creating a new bridge network. But, it does need to
be rearranged after setting up Swarm ingress.

Similarly, the jump to DOCKER-INGRESS no longer needs to be
shuffled back to the top of the FORWARD chain after adding a
new network.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-17 09:14:26 +00:00
Rob Murray
9699284e8f Add iptablesdoc for a swarm network
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-17 09:14:25 +00:00
Rob Murray
6473d37002 Run commands in an L3Segment netns without failing the test.
Return an error from runCommand instead of calling t.Fatal, and add
Host.Run to return that error.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-17 09:14:25 +00:00
Rob Murray
3bf9a80818 Rename L3Segment Host.Run -> Host.MustRun
Like netip.MustParseIP, it fails on error.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-17 09:14:25 +00:00
Rob Murray
29e20fc904 Add static filter-FORWARD rules during bridge driver init
Rules no longer need to be rearranged when creating a network.

Per-network rules are always appended to the FORWARD chain so,
after adding them, there's no need to delete the per-driver
rules to re-insert them at the top of the chain.

Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-17 09:14:25 +00:00
Rob Murray
5ccc699513 Use golden testdata in TestUserChain
Signed-off-by: Rob Murray <rob.murray@docker.com>
2024-12-17 09:14:25 +00:00
Akihiro Suda
eb84d54bfa Merge pull request #49116 from tonistiigi/update-buildkit-v0.18.2
vendor: update buildkit to v0.18.2
2024-12-17 13:35:05 +09:00
Tonis Tiigi
cd81985bfa vendor: update buildkit to v0.18.2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-12-16 15:43:08 -08:00
Sebastiaan van Stijn
84dfd48d48 Merge pull request #49073 from dmcgowan/archive-remove-ioutils
Decouple pkg/archive from pkg/ioutils
2024-12-16 23:50:02 +01:00
Sebastiaan van Stijn
d688389f4a libnetwork/iptables: deprecate Passthrough
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-16 23:23:11 +01:00
Sebastiaan van Stijn
8991c4e382 Deprecate BridgeNfIptables and BridgeNfIp6tables fields
The netfilter module is now loaded on-demand, and no longer during daemon
startup, making these fields obsolete. These fields are now always `false`
and will be removed in the next relase.

This patch deprecates:

- the `BridgeNfIptables` field in `api/types/system.Info`
- the `BridgeNfIp6tables` field in `api/types/system.Info`
- the `BridgeNFCallIPTablesDisabled` field in `pkg/sysinfo.SysInfo`
- the `BridgeNFCallIP6TablesDisabled` field in `pkg/sysinfo.SysInfo`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-16 22:10:05 +01:00
Sebastiaan van Stijn
30a365f543 docs/api: version-history.md: fix markdown
Fixes a typo introduced in 1932091e21

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-16 21:57:05 +01:00
Sebastiaan van Stijn
9fe5649fed Merge pull request #49109 from thaJeztah/fix_setupIPChains_defer
libnetwork/drivers/bridge: setupIPChains: fix defer checking wrong err
2024-12-16 18:43:07 +01:00
Sebastiaan van Stijn
1519004fc2 Merge pull request #49103 from thaJeztah/update_swagger_headers
docs/api: document correct case for Api-Version header
2024-12-16 18:17:35 +01:00
Sebastiaan van Stijn
01a55860c6 libnetwork/drivers/bridge: setupIPChains: fix defer checking wrong err
The output variable was renamed in 0503cf2510,
but that commit failed to change this defer, which was now checking the
wrong error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-16 16:46:31 +01:00
Sebastiaan van Stijn
31fc7dd750 libcontainer: ReplaceContainer: fix var shadowing import
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-12-16 16:35:44 +01:00
Sebastiaan van Stijn
51abfcbf4f Merge pull request #49098 from thaJeztah/deprecate_pkg_system
pkg/system: deprecate types and functions that are only used internally
2024-12-16 16:04:58 +01:00
Sebastiaan van Stijn
aa052c8985 Merge pull request #49101 from thaJeztah/archive_stdlib_errs
pkg/archive: replace uses of pkg/errors for stdlib errors
2024-12-16 15:23:20 +01:00
Sebastiaan van Stijn
baabbb4fa2 Merge pull request #49102 from thaJeztah/denoise_TestBuildEmitsImageCreateEvent
integration/build: make TestBuildEmitsImageCreateEvent less noisy
2024-12-16 15:22:22 +01:00