fix: handle gzip-compressed and bsdtar-produced OCI RemoteURL layers - #1911
Merged
Conversation
`RemoteURL`'s `oci://` path had two gaps that caused real-world OCI artifacts to fail or get misread: 1. **Gzip-compressed layers weren't decompressed.** A gzip-compressed tar fails the tar parse and falls through to the raw-blob branch, so the compressed bytes were handed downstream as if they were YAML and died with `yaml: control characters are not allowed`. 2. **AppleDouble and PAX header entries weren't filtered.** The extraction loop matched any `tar.TypeReg` entry by extension alone. A tar built with macOS's default `bsdtar` writes extended-attribute sidecar files like `._ns.yaml` next to `ns.yaml`; these match the `.yaml` filter and inject binary AppleDouble data into the concatenated manifest. Some tar implementations also materialize PAX extended headers as ordinary path entries (e.g. under a `PaxHeader/` prefix) instead of merging them into the following entry, which could get swept in the same way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RemoteURL'soci://path had two gaps that caused real-world OCI artifacts to fail or get misread:Gzip-compressed layers weren't decompressed. A gzip-compressed tar fails the tar parse and falls through to the raw-blob branch, so the compressed bytes were handed downstream as if they were YAML and died with
yaml: control characters are not allowed.AppleDouble and PAX header entries weren't filtered. The extraction loop matched any
tar.TypeRegentry by extension alone. A tar built with macOS's defaultbsdtarwrites extended-attribute sidecar files like._ns.yamlnext tons.yaml; these match the.yamlfilter and inject binary AppleDouble data into the concatenated manifest. Some tar implementations also materialize PAX extended headers as ordinary path entries (e.g. under aPaxHeader/prefix) instead of merging them into the following entry, which could get swept in the same way.