Skip to content

[27.x backport] daemon: info: remove bridge-nf-call-iptables / ip6tables warnings#49090

Merged
thaJeztah merged 1 commit intomoby:27.xfrom
thaJeztah:27.x_backport_no_netfilter_warnings
Dec 13, 2024
Merged

[27.x backport] daemon: info: remove bridge-nf-call-iptables / ip6tables warnings#49090
thaJeztah merged 1 commit intomoby:27.xfrom
thaJeztah:27.x_backport_no_netfilter_warnings

Conversation

@thaJeztah
Copy link
Copy Markdown
Member


daemon: info: remove bridge-nf-call-iptables / ip6tables warnings

Historically, the bridge network-driver would detect whether netfiltering was enabled in the kernel or, if disabled, try to do a modprobe when initializing the driver. This approach became problematic, as loading the module was not always performed at startup depending on daemon configuration, or the daemon may have failed to load the module. The /info response would include a warning to inform the user that some functionality may not be available;

WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

Starting with db25b0d, detecting whether netfiltering is enabled now happens when needed, which was further improved on to not depend on modprobe in 264c15b and 4740820.

Because of the above, the /info output would now return warnings in any situation where netfiltering was not enabled on the host before the daemon started, which may be either incorrect (i.e., the module may have been loaded afterwards), or irrelevant, because netfiltering is not needed in all situations.

This patch removes the warnings from the /info response,

- Description for the changelog

* `docker info` and the corresponding `GET /info` API endpoint no longer include
  warnings when `bridge-nf-call-iptables` or `bridge-nf-call-ip6tables` are
  disabled at the daemon is started. The `br_netfilter` kernel module is now
  attempted to be loaded when needed, which made those warnings inaccurate.

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

Historically, the `bridge` network-driver would detect whether netfiltering
was enabled in the kernel or, if disabled, try to do a `modprobe` when
initializing the driver. This approach became problematic, as loading the
module was not always performed  at startup depending on daemon configuration,
or the daemon may have failed to load the module. The `/info` response
would include a warning  to inform the user that some functionality may not
be available;

    WARNING: bridge-nf-call-iptables is disabled
    WARNING: bridge-nf-call-ip6tables is disabled

Starting with db25b0d, detecting whether
netfiltering  is enabled now [happens when needed][1], which was further improved
on to not depend  on `modprobe` in 264c15b and
4740820.

Because of the above, the `/info` output would now return warnings in any
situation where netfiltering was not enabled on the host before the daemon
started, which may be either _incorrect_ (i.e., the module may have been
loaded afterwards), or irrelevant, because netfiltering is not needed in
all situations.

This patch removes the warnings from the `/info` response,

[1]: https://github.com/moby/moby/blob/944e40350259f040950d871d402d848ff2a799bc/libnetwork/drivers/bridge/setup_bridgenetfiltering.go#L16-L77

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5c35874)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the 27.4.1 milestone Dec 13, 2024
@thaJeztah thaJeztah self-assigned this Dec 13, 2024
@thaJeztah thaJeztah changed the title daemon: info: remove bridge-nf-call-iptables / ip6tables warnings [27.x backport] daemon: info: remove bridge-nf-call-iptables / ip6tables warnings Dec 13, 2024
@thaJeztah thaJeztah merged commit 24f2f4f into moby:27.x Dec 13, 2024
@thaJeztah thaJeztah deleted the 27.x_backport_no_netfilter_warnings branch December 13, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants