mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
libnet: makeDriverConfig: drop support for label-based config
makeDriverConfig is written in such a way that it seems to support
label-based driver configuration. That is, you could hypothetically use
labels starting with `com.docker.network.driver.<driver-name>.` to
define the configuration of a driver.
These labels come from the Controller's `cfg.Labels` which are set by
the daemon through libnet's OptionLabels which takes the list of labels
set on the daemon through dockerd's --label flag, or the equivalent
daemon.json field.
However, the daemon forbids setting labels that start with
`com.docker.*`. For instance:
label com.docker.network.driver.bridge.EnableProxy=false is not allowed: the namespaces com.docker.*, io.docker.*, and org.dockerproject.* are reserved for internal use
Hence, this is dead code — remove it.
Also, makeDriverConfig is checking if the Controller's cfg field is
nil... But the Controller struct is instantiated in a single place (i.e.
NewController) and it always set that field. Drop that nil check too.
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This commit is contained in:
@@ -1649,7 +1649,6 @@ func (daemon *Daemon) networkOptions(conf *config.Config, pg plugingetter.Plugin
|
||||
nwconfig.OptionExecRoot(conf.GetExecRoot()),
|
||||
nwconfig.OptionDefaultDriver(network.DefaultNetwork),
|
||||
nwconfig.OptionDefaultNetwork(network.DefaultNetwork),
|
||||
nwconfig.OptionLabels(conf.Labels),
|
||||
nwconfig.OptionNetworkControlPlaneMTU(conf.NetworkControlPlaneMTU),
|
||||
nwconfig.OptionFirewallBackend(conf.FirewallBackend),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user