plugins: SetConfig shouldn't panic on nil driver configs

This commit is contained in:
Michael Schurter
2018-10-30 17:14:27 -07:00
parent fd2fcd7cb6
commit e7bf482eaa

View File

@@ -64,9 +64,11 @@ func (b *basePluginServer) SetConfig(ctx context.Context, req *proto.SetConfigRe
cfg := nomadConfigFromProto(req.GetNomadConfig())
filteredCfg := new(ClientAgentConfig)
switch info.Type {
case PluginTypeDriver:
filteredCfg.Driver = cfg.Driver
if cfg != nil {
switch info.Type {
case PluginTypeDriver:
filteredCfg.Driver = cfg.Driver
}
}
// Set the config