Skip to content

Commit 0b4cd89

Browse files
committed
mcv: don't sanitize triton paths
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
1 parent 33bc359 commit 0b4cd89

File tree

2 files changed

+2
-30
lines changed

2 files changed

+2
-30
lines changed

mcv/pkg/cache/cache.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -245,22 +245,6 @@ func extractCacheAndManifestDirectory(
245245
}
246246
}
247247

248-
// Fix up cache JSONs
249-
err = filepath.Walk(extractCacheDir, func(path string, info os.FileInfo, err error) error {
250-
if err != nil {
251-
return err
252-
}
253-
if !info.IsDir() && strings.HasPrefix(info.Name(), "__grp__") && strings.HasSuffix(info.Name(), ".json") {
254-
if err := utils.RestoreFullPathsInGroupJSON(path, extractCacheDir); err != nil {
255-
logging.Warnf("failed to restore full paths in %s: %v", path, err)
256-
}
257-
}
258-
return nil
259-
})
260-
if err != nil {
261-
return nil, fmt.Errorf("error restoring full paths in cache JSON files: %w", err)
262-
}
263-
264248
return extractedDirs, nil
265249
}
266250

mcv/pkg/fetcher/imgfetcher.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -478,20 +478,8 @@ func validateExtractedCacheSize(labels map[string]string, cacheType, extractedDi
478478
return fmt.Errorf("failed to calculate extracted cache size: %w", err)
479479
}
480480

481-
// For vanilla Triton cache, allow a small difference due to group JSON path restoration
482-
// The RestoreFullPathsInGroupJSON function adds paths during extraction
483-
tolerance := int64(0)
484-
if cacheType == constants.Triton {
485-
// Allow up to 1KB per file for JSON formatting differences
486-
tolerance = 1024
487-
}
488-
489-
diff := actualSize - expectedSize
490-
if diff < 0 {
491-
diff = -diff
492-
}
493-
494-
if diff > tolerance {
481+
// Validate exact match - no tolerance needed since we no longer modify files during extraction
482+
if actualSize != expectedSize {
495483
return fmt.Errorf("cache size mismatch: expected %d bytes, extracted %d bytes (diff: %d)", expectedSize, actualSize, actualSize-expectedSize)
496484
}
497485

0 commit comments

Comments
 (0)