Skip to content

Commit 5fb7af3

Browse files
authored
[shim] Fix DCGMWrapperInterface nil check (#2980)
Fixes: #2979
1 parent 70b85f1 commit 5fb7af3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

runner/internal/shim/api/handlers.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"net/http"
7+
"reflect"
78

89
"github.com/dstackai/dstack/runner/internal/api"
910
"github.com/dstackai/dstack/runner/internal/log"
@@ -24,7 +25,7 @@ func (s *ShimServer) HealthcheckHandler(w http.ResponseWriter, r *http.Request)
2425
func (s *ShimServer) InstanceHealthHandler(w http.ResponseWriter, r *http.Request) (interface{}, error) {
2526
ctx := r.Context()
2627
response := InstanceHealthResponse{}
27-
if s.dcgmWrapper != nil {
28+
if !reflect.ValueOf(s.dcgmWrapper).IsNil() {
2829
if dcgmHealth, err := s.dcgmWrapper.GetHealth(); err != nil {
2930
log.Error(ctx, "failed to get health from DCGM", "err", err)
3031
} else {

0 commit comments

Comments
 (0)