Skip to content

Conversation

@ktock
Copy link
Member

@ktock ktock commented Dec 19, 2020

google/go-containerregistry#879 (comment)

Since this commit, WithPrioritiedFiles option accepts "/"-prefixed prioritied
files. It's also accepted that file entreis in the input tar are prefixed by
"./" or "/".

This should be merged after #212 is merged and conflicts are resolved.

cc @AkihiroSuda @mattmoor

if strings.HasPrefix(name, "./") {
return strings.TrimPrefix(name, "./")
}
return name
Copy link
Member

@AkihiroSuda AkihiroSuda Dec 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens for ../foo/bar (when consuming a tar archive created by other program)

@ktock ktock marked this pull request as draft December 19, 2020 15:14
Since this commit, WithPrioritiedFiles option accepts absolute paths and paths
that rellative to root (e.g. paths prefixed with "./").
The input tar can include files that are relative to root (e.g. prefixed with
"./"). So, in this commit, the specified prioritized file paths are normalized
(using filepath.Clean()) and are compared against normalized tar entry names.

Signed-off-by: Kohei Tokunaga <[email protected]>
@ktock ktock marked this pull request as ready for review December 19, 2020 15:28
@AkihiroSuda AkihiroSuda merged commit 8a8038a into containerd:master Dec 19, 2020
@ktock ktock deleted the pnormalize branch October 7, 2022 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants