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
This commit is contained in:
Sebastiaan van Stijn 2024-01-23 17:05:02 +01:00 committed by GitHub
commit 613b6a12c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View file

@ -301,7 +301,13 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
routerCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
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 {
return err
}

View file

@ -180,6 +180,11 @@ func (daemon *Daemon) config() *configStore {
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
func (daemon *Daemon) HasExperimental() bool {
return daemon.config().Experimental