Skip to content

Conversation

@ambarve
Copy link
Contributor

@ambarve ambarve commented Nov 4, 2021

When extracting a container image layer tar, some files can show in an out of order
fashion (i.e the file shows up first before its parent directory shows up). We already
handle this by creating these parent directories if they don't already exist. However,
that handling didn't apply to whiteout files. This commit fixes that.

Signed-off-by: Amit Barve [email protected]

When extracting a container image layer tar, some files can show in an out of order
fashion (i.e the file shows up first before its parent directory shows up). We already
handle this by creating these parent directories if they don't already exist. However,
that handling didn't apply to whiteout files. This commit fixes that.

Signed-off-by: Amit Barve <[email protected]>
@ambarve ambarve requested a review from a team as a code owner November 4, 2021 20:03
Signed-off-by: Amit Barve <[email protected]>
Signed-off-by: Amit Barve <[email protected]>
Copy link

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

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

lgtm

// copy over existing xattrs first, we need to merge existing xattrs and the passed xattrs.
existingXattrs := make(map[string][]byte)
if len(node.XattrInline) > 0 {
getXattrs(node.XattrInline[4:], existingXattrs, 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

From 4 onwards to skip the header? (format.XAttrHeaderMagic)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep.

Copy link
Contributor

@dcantah dcantah left a comment

Choose a reason for hiding this comment

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

Small question, but lgtm! Make sure to squash

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.

3 participants