Skip to content

Modern Docker Management, Designed for Everyone

fix: properly assign inUse status to volume return data

Kyle Mendell71623e33eadf
diff --git a/backend/internal/api/system_handler.go b/backend/internal/api/system_handler.go
index 3f8f91727..91b531115 100644
--- a/backend/internal/api/system_handler.go
+++ b/backend/internal/api/system_handler.go
@@ -684,8 +684,6 @@ func (h *SystemHandler) detectGPUs(ctx context.Context) error {
h.detectionMutex.Lock()
defer h.detectionMutex.Unlock()
- slog.DebugContext(ctx, "Starting GPU detection")
-
// Check for NVIDIA
if path, err := exec.LookPath("nvidia-smi"); err == nil {
h.gpuDetectionCache.Lock()
diff --git a/backend/internal/services/volume_service.go b/backend/internal/services/volume_service.go
index 1f91f7181..17fa04de4 100644
--- a/backend/internal/services/volume_service.go
+++ b/backend/internal/services/volume_service.go
@@ -70,6 +70,9 @@ func (s *VolumeService) GetVolumeByName(ctx context.Context, name string) (*dto.
slog.String("error", err.Error()))
} else {
v.Containers = containerIDs
+ if len(containerIDs) > 0 {
+ v.InUse = true
+ }
}
return &v, nil
@@ -399,6 +402,9 @@ func (s *VolumeService) ListVolumesPaginated(ctx context.Context, params paginat
volDto := dto.NewVolumeDto(v)
if containerIDs, ok := volumeContainerMap[v.Name]; ok {
volDto.Containers = containerIDs
+ if len(containerIDs) > 0 {
+ volDto.InUse = true
+ }
}
items = append(items, volDto)
}