mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
plugins: validate logmon process during reattach (#24798)
This commit is contained in:
committed by
GitHub
parent
679642c8bf
commit
34a34e7233
3
.changelog/24798.txt
Normal file
3
.changelog/24798.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
drivers: validate logmon plugin during reattach
|
||||
```
|
||||
@@ -59,6 +59,16 @@ func LaunchLogMon(logger hclog.Logger, reattachConfig *plugin.ReattachConfig) (L
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// Note: Similar to reattaching to executors, Go-plugin uses localhost
|
||||
// ports on Windows. On reattach, it may attach to another process
|
||||
// listening on that port. We should validate it is actually a plugin.
|
||||
if conf.Reattach != nil {
|
||||
if err := rpcClient.Ping(); err != nil {
|
||||
logger.Warn("failed to ping plugin process during reattach", "error", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
}
|
||||
|
||||
l := raw.(LogMon)
|
||||
return l, client, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user