cmd/dockerd: rewrite getSwarmRunRoot to a regular func

This method only required the config to be passed; rewrite it to a
regular func that accepts the config.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-02-19 17:22:33 +01:00
parent 29c296e1dd
commit 29aa7e15bd
3 changed files with 4 additions and 4 deletions

View File

@@ -941,7 +941,7 @@ func createAndStartCluster(cli *daemonCLI, d *daemon.Daemon) (*cluster.Cluster,
DefaultAdvertiseAddr: cli.Config.SwarmDefaultAdvertiseAddr,
RaftHeartbeatTick: cli.Config.SwarmRaftHeartbeatTick,
RaftElectionTick: cli.Config.SwarmRaftElectionTick,
RuntimeRoot: cli.getSwarmRunRoot(),
RuntimeRoot: getSwarmRunRoot(cli.Config),
})
if err != nil {
return nil, err

View File

@@ -66,8 +66,8 @@ func (cli *daemonCLI) setupConfigReloadTrap() {
// getSwarmRunRoot gets the root directory for swarm to store runtime state
// For example, the control socket
func (cli *daemonCLI) getSwarmRunRoot() string {
return filepath.Join(cli.Config.ExecRoot, "swarm")
func getSwarmRunRoot(cfg *config.Config) string {
return filepath.Join(cfg.ExecRoot, "swarm")
}
// allocateDaemonPort ensures that there are no containers

View File

@@ -88,7 +88,7 @@ func (cli *daemonCLI) setupConfigReloadTrap() {
// getSwarmRunRoot gets the root directory for swarm to store runtime state
// For example, the control socket
func (cli *daemonCLI) getSwarmRunRoot() string {
func getSwarmRunRoot(*config.Config) string {
return ""
}