Skip to content

Commit

Permalink
Use tar-split/tar/asm.IterateHeaders now that it has been accepted
Browse files Browse the repository at this point in the history
... instead of our version which makes assumptions on the
internal decisions of the tar-split project, and needs heuristics
to guess where file padding ends.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
  • Loading branch information
mtrmac committed Sep 27, 2024
1 parent f45f1ed commit 39e467a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 173 deletions.
6 changes: 5 additions & 1 deletion pkg/chunked/compression_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package chunked

import (
archivetar "archive/tar"
"bytes"
"errors"
"fmt"
"io"
Expand All @@ -14,6 +15,8 @@ import (
"github.com/klauspost/pgzip"
digest "github.com/opencontainers/go-digest"
"github.com/vbatts/tar-split/archive/tar"
"github.com/vbatts/tar-split/tar/asm"
"github.com/vbatts/tar-split/tar/storage"
expMaps "golang.org/x/exp/maps"
)

Expand Down Expand Up @@ -256,7 +259,8 @@ func ensureTOCMatchesTarSplit(toc *internal.TOC, tarSplit []byte) error {
}
}

if err := iterateTarSplit(tarSplit, func(hdr *tar.Header) error {
unpacker := storage.NewJSONUnpacker(bytes.NewReader(tarSplit))
if err := asm.IterateHeaders(unpacker, func(hdr *tar.Header) error {
e, ok := pendingFiles[hdr.Name]
if !ok {
return fmt.Errorf("tar-split contains an entry for %q missing in TOC", hdr.Name)
Expand Down
68 changes: 0 additions & 68 deletions pkg/chunked/tar_split_linux.go

This file was deleted.

104 changes: 0 additions & 104 deletions pkg/chunked/tar_split_linux_test.go

This file was deleted.

0 comments on commit 39e467a

Please sign in to comment.