Skip to content

Commit fe339e3

Browse files
authored
Merge pull request #7 from AliyunContainerService/dev-watch-sgx-sock-delete
[Feature] Add SGX unix socket detection support
2 parents dbfc59c + c622bd7 commit fe339e3

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

cmd/sgx-device-plugin/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ L:
6464
klog.Infof("Inotify: %s created, restarting ...", devicepluginapi.KubeletSocket)
6565
restart = true
6666
}
67+
if event.Name == deviceplugin.ServerSock && event.Op&fsnotify.Remove == fsnotify.Remove {
68+
klog.Infof("Inotify: %s removed, restarting ...", deviceplugin.ServerSock)
69+
restart = true
70+
}
6771

6872
case err := <-watcher.Errors:
6973
klog.Infof("inotify: %s", err)

pkg/device_plugin/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const (
2121
// ResourceNameSGX is resource name registered to kubelet.
2222
ResourceNameSGX = vendor + "/sgx_epc_MiB"
2323

24-
serverSock = devicepluginapi.DevicePluginPath + "/sgx.sock"
24+
ServerSock = devicepluginapi.DevicePluginPath + "sgx.sock"
2525
envDisableHealthChecks = "DP_DISABLE_HEALTHCHECKS"
2626
allHealthChecks = "xids"
2727

@@ -42,7 +42,7 @@ func NewSGXDevicePlugin() (*SGXDevicePlugin, error) {
4242

4343
return &SGXDevicePlugin{
4444
devs: devs,
45-
socket: serverSock,
45+
socket: ServerSock,
4646

4747
stop: make(chan interface{}),
4848
health: make(chan *devicepluginapi.Device),

0 commit comments

Comments
 (0)