drivers: update SetConfig to handle driver client config

This commit is contained in:
Nick Ethier 2018-10-18 23:32:17 -04:00
parent 58b430edae
commit 9916b9e0ce
No known key found for this signature in database
GPG key ID: 07C1A3ECED90D24A
3 changed files with 12 additions and 6 deletions

View file

@ -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
} }

View file

@ -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
} }

View file

@ -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
} }