diff --git a/cmd/sgx-device-plugin/main.go b/cmd/sgx-device-plugin/main.go index 9638856..33e9a92 100644 --- a/cmd/sgx-device-plugin/main.go +++ b/cmd/sgx-device-plugin/main.go @@ -64,6 +64,10 @@ L: klog.Infof("Inotify: %s created, restarting ...", devicepluginapi.KubeletSocket) restart = true } + if event.Name == deviceplugin.ServerSock && event.Op&fsnotify.Remove == fsnotify.Remove { + klog.Infof("Inotify: %s removed, restarting ...", deviceplugin.ServerSock) + restart = true + } case err := <-watcher.Errors: klog.Infof("inotify: %s", err) diff --git a/pkg/device_plugin/server.go b/pkg/device_plugin/server.go index be49179..be5ec6e 100644 --- a/pkg/device_plugin/server.go +++ b/pkg/device_plugin/server.go @@ -21,7 +21,7 @@ const ( // ResourceNameSGX is resource name registered to kubelet. ResourceNameSGX = vendor + "/sgx_epc_MiB" - serverSock = devicepluginapi.DevicePluginPath + "/sgx.sock" + ServerSock = devicepluginapi.DevicePluginPath + "sgx.sock" envDisableHealthChecks = "DP_DISABLE_HEALTHCHECKS" allHealthChecks = "xids" @@ -42,7 +42,7 @@ func NewSGXDevicePlugin() (*SGXDevicePlugin, error) { return &SGXDevicePlugin{ devs: devs, - socket: serverSock, + socket: ServerSock, stop: make(chan interface{}), health: make(chan *devicepluginapi.Device),