Skip to content

Commit 334533a

Browse files
committed
fix how volumes are trimmed
1 parent 8157adb commit 334533a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Sources/Services/RuntimeLinux/Server/RuntimeService.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,9 +872,11 @@ public actor RuntimeService {
872872
// Perform filesystem trim on the root filesystem
873873
try await ctr.container.filesystemOperation(operation: .trim, path: "/")
874874

875-
// Perform filesystem trim on each named volume mount
875+
// Trim all block-backed mounts. Named volumes are expected to be
876+
// block-backed, and may be represented as either `.volume` or
877+
// `.block` depending on how configuration was created.
876878
for mount in ctr.config.mounts {
877-
if case .volume = mount.type {
879+
if mount.isBlock {
878880
try await ctr.container.filesystemOperation(operation: .trim, path: mount.destination)
879881
}
880882
}

0 commit comments

Comments
 (0)