From c73ae40cff19344f68c8a0d6d59d778f82f05f1f Mon Sep 17 00:00:00 2001 From: Dmitry Meyer Date: Wed, 13 Aug 2025 10:34:40 +0000 Subject: [PATCH] [shim] Fix `DCGMWrapperInterface` nil check Fixes: https://github.com/dstackai/dstack/issues/2979 --- runner/internal/shim/api/handlers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runner/internal/shim/api/handlers.go b/runner/internal/shim/api/handlers.go index 1374fbd803..94eb485076 100644 --- a/runner/internal/shim/api/handlers.go +++ b/runner/internal/shim/api/handlers.go @@ -4,6 +4,7 @@ import ( "context" "errors" "net/http" + "reflect" "github.com/dstackai/dstack/runner/internal/api" "github.com/dstackai/dstack/runner/internal/log" @@ -24,7 +25,7 @@ func (s *ShimServer) HealthcheckHandler(w http.ResponseWriter, r *http.Request) func (s *ShimServer) InstanceHealthHandler(w http.ResponseWriter, r *http.Request) (interface{}, error) { ctx := r.Context() response := InstanceHealthResponse{} - if s.dcgmWrapper != nil { + if !reflect.ValueOf(s.dcgmWrapper).IsNil() { if dcgmHealth, err := s.dcgmWrapper.GetHealth(); err != nil { log.Error(ctx, "failed to get health from DCGM", "err", err) } else {