node: sample-dp: set default value for pluginSocksDir

Setting a reasonable default in case `PLUGIN_SOCK_DIR`
environment variable is not specified.

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
This commit is contained in:
Swati Sehgal 2023-06-20 14:15:31 +01:00
parent 211d8cc80a
commit f46cdf1428

View File

@ -93,8 +93,7 @@ func main() {
pluginSocksDir := os.Getenv("PLUGIN_SOCK_DIR")
klog.Infof("pluginSocksDir: %s", pluginSocksDir)
if pluginSocksDir == "" {
klog.Errorf("Empty pluginSocksDir")
return
pluginSocksDir = pluginapi.DevicePluginPath
}
socketPath := pluginSocksDir + "/dp." + fmt.Sprintf("%d", time.Now().Unix())