-
Notifications
You must be signed in to change notification settings - Fork 275
Handling of out-of-order whiteout files during tar expansion #1218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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]>
Signed-off-by: Amit Barve <[email protected]>
Signed-off-by: Amit Barve <[email protected]>
Signed-off-by: Amit Barve <[email protected]>
katiewasnothere
left a comment
There was a problem hiding this 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) |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
dcantah
left a comment
There was a problem hiding this 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
Related work items: microsoft#1067, microsoft#1097, microsoft#1119, microsoft#1170, microsoft#1176, microsoft#1180, microsoft#1181, microsoft#1182, microsoft#1183, microsoft#1184, microsoft#1185, microsoft#1186, microsoft#1187, microsoft#1188, microsoft#1189, microsoft#1191, microsoft#1193, microsoft#1194, microsoft#1195, microsoft#1196, microsoft#1197, microsoft#1200, microsoft#1201, microsoft#1202, microsoft#1203, microsoft#1204, microsoft#1205, microsoft#1206, microsoft#1207, microsoft#1209, microsoft#1210, microsoft#1211, microsoft#1218, microsoft#1219, microsoft#1220, microsoft#1223
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]