api/types/system: change legacyDiskUsage to a non-pointer slice

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-11-06 10:34:56 +01:00
parent ff019cd853
commit 0029924181
10 changed files with 48 additions and 116 deletions

View File

@@ -150,15 +150,15 @@ func (b *Builder) Cancel(ctx context.Context, id string) error {
}
// DiskUsage returns a report about space used by build cache
func (b *Builder) DiskUsage(ctx context.Context) ([]*build.CacheRecord, error) {
func (b *Builder) DiskUsage(ctx context.Context) ([]build.CacheRecord, error) {
duResp, err := b.controller.DiskUsage(ctx, &controlapi.DiskUsageRequest{})
if err != nil {
return nil, err
}
var items []*build.CacheRecord
var items []build.CacheRecord
for _, r := range duResp.Record {
items = append(items, &build.CacheRecord{
items = append(items, build.CacheRecord{
ID: r.ID,
Parents: r.Parents,
Type: r.RecordType,