Specify temp dir so socket is created in the right place

This commit is contained in:
Nathan Verzemnieks
2026-01-14 12:44:31 +01:00
parent 10650ae196
commit 34d6243685
@@ -1,6 +1,7 @@
package grpcplugin
import (
"os"
"os/exec"
"runtime"
@@ -84,6 +85,12 @@ func newClientConfig(descriptor PluginDescriptor, env []string, logger log.Logge
if descriptor.runnerFunc != nil {
cfg.RunnerFunc = descriptor.runnerFunc
td, err := os.MkdirTemp("", "plugin")
if err != nil {
// TODO: what do we do here?
td = "/tmp"
}
cfg.UnixSocketConfig = &goplugin.UnixSocketConfig{TempDir: td}
logger.Debug("Using runner mode", "os", runtime.GOOS, "executablePath", executablePath)
} else {
logger.Debug("Using process mode", "os", runtime.GOOS, "executablePath", executablePath)