Skip to content

Commit

Permalink
Merge pull request #7 from AliyunContainerService/dev-watch-sgx-sock-…
Browse files Browse the repository at this point in the history
…delete

[Feature] Add SGX unix socket detection support
  • Loading branch information
stormgbs authored Jan 6, 2020
2 parents dbfc59c + c622bd7 commit fe339e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cmd/sgx-device-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pkg/device_plugin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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),
Expand Down

0 comments on commit fe339e3

Please sign in to comment.