drivers: update SetConfig to handle driver client config
This commit is contained in:
parent
58b430edae
commit
9916b9e0ce
|
@ -73,7 +73,7 @@ type ExecDriver struct {
|
||||||
config *Config
|
config *Config
|
||||||
|
|
||||||
// nomadConfig is the client config from nomad
|
// nomadConfig is the client config from nomad
|
||||||
nomadConfig *base.NomadConfig
|
nomadConfig *base.NomadDriverConfig
|
||||||
|
|
||||||
// tasks is the in memory datastore mapping taskIDs to execDriverHandles
|
// tasks is the in memory datastore mapping taskIDs to execDriverHandles
|
||||||
tasks *taskStore
|
tasks *taskStore
|
||||||
|
@ -142,7 +142,9 @@ func (d *ExecDriver) SetConfig(data []byte, cfg *base.NomadConfig) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
d.config = &config
|
d.config = &config
|
||||||
d.nomadConfig = cfg
|
if cfg != nil {
|
||||||
|
d.nomadConfig = cfg.Driver
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ type RawExecDriver struct {
|
||||||
config *Config
|
config *Config
|
||||||
|
|
||||||
// nomadConfig is the client config from nomad
|
// nomadConfig is the client config from nomad
|
||||||
nomadConfig *base.NomadConfig
|
nomadConfig *base.NomadDriverConfig
|
||||||
|
|
||||||
// tasks is the in memory datastore mapping taskIDs to rawExecDriverHandles
|
// tasks is the in memory datastore mapping taskIDs to rawExecDriverHandles
|
||||||
tasks *taskStore
|
tasks *taskStore
|
||||||
|
@ -179,7 +179,9 @@ func (r *RawExecDriver) SetConfig(data []byte, cfg *base.NomadConfig) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
r.config = &config
|
r.config = &config
|
||||||
r.nomadConfig = cfg
|
if cfg != nil {
|
||||||
|
r.nomadConfig = cfg.Driver
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ type RktDriver struct {
|
||||||
config *Config
|
config *Config
|
||||||
|
|
||||||
// nomadConfig is the client config from nomad
|
// nomadConfig is the client config from nomad
|
||||||
nomadConfig *base.NomadConfig
|
nomadConfig *base.NomadDriverConfig
|
||||||
|
|
||||||
// tasks is the in memory datastore mapping taskIDs to rktTaskHandles
|
// tasks is the in memory datastore mapping taskIDs to rktTaskHandles
|
||||||
tasks *taskStore
|
tasks *taskStore
|
||||||
|
@ -200,7 +200,9 @@ func (d *RktDriver) SetConfig(data []byte, cfg *base.NomadConfig) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
d.config = &config
|
d.config = &config
|
||||||
d.nomadConfig = cfg
|
if cfg != nil {
|
||||||
|
d.nomadConfig = cfg.Driver
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue