Browse Source

Merge pull request #47192 from thaJeztah/25.0_backport_fix_gateway_ip

[25.0 backport] fix "host-gateway-ip" label not set for builder workers
Sebastiaan van Stijn 1 year ago
parent
commit
613b6a12c1
2 changed files with 12 additions and 1 deletions
  1. 7 1
      cmd/dockerd/daemon.go
  2. 5 0
      daemon/daemon.go

+ 7 - 1
cmd/dockerd/daemon.go

@@ -301,7 +301,13 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
 	routerCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
 	routerCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
 	defer cancel()
 	defer cancel()
 
 
-	routerOptions, err := newRouterOptions(routerCtx, cli.Config, d)
+	// Get a the current daemon config, because the daemon sets up config
+	// during initialization. We cannot user the cli.Config for that reason,
+	// as that only holds the config that was set by the user.
+	//
+	// FIXME(thaJeztah): better separate runtime and config data?
+	daemonCfg := d.Config()
+	routerOptions, err := newRouterOptions(routerCtx, &daemonCfg, d)
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}

+ 5 - 0
daemon/daemon.go

@@ -180,6 +180,11 @@ func (daemon *Daemon) config() *configStore {
 	return cfg
 	return cfg
 }
 }
 
 
+// Config returns daemon's config.
+func (daemon *Daemon) Config() config.Config {
+	return daemon.config().Config
+}
+
 // HasExperimental returns whether the experimental features of the daemon are enabled or not
 // HasExperimental returns whether the experimental features of the daemon are enabled or not
 func (daemon *Daemon) HasExperimental() bool {
 func (daemon *Daemon) HasExperimental() bool {
 	return daemon.config().Experimental
 	return daemon.config().Experimental