Skip to content

Commit dff44dc

Browse files
authored
exit the device plugin when creating failed (#48)
1 parent b0d42f5 commit dff44dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/gpu/nvidia/gpumanager.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"github.com/AliyunContainerService/gpushare-device-plugin/pkg/kubelet/client"
66
"syscall"
7+
"os"
78
"time"
89

910
"github.com/NVIDIA/gpu-monitoring-tools/bindings/go/nvml"
@@ -69,8 +70,10 @@ L:
6970
devicePlugin, err = NewNvidiaDevicePlugin(ngm.enableMPS, ngm.healthCheck, ngm.queryKubelet, ngm.kubeletClient)
7071
if err != nil {
7172
log.Warningf("Failed to get device plugin due to %v", err)
73+
os.Exit(1)
7274
} else if err = devicePlugin.Serve(); err != nil {
7375
log.Warningf("Failed to start device plugin due to %v", err)
76+
os.Exit(2)
7477
} else {
7578
restart = false
7679
}

0 commit comments

Comments
 (0)