Add resolve file attributes from hdr.Xattrs#2872
Add resolve file attributes from hdr.Xattrs#2872Ace-Tang wants to merge 1 commit intocontainerd:masterfrom
Conversation
Through golang indicate that tar header field 'Xattrs' should be Deprecated, but moby still use 'Xattrs' to deal with file extended attributes, maybe other image build tools also do this way. Add resolve file attributes from 'hdr.Xattrs' make these images work good, let extended file take effect. Fixes: containerd#2863 Signed-off-by: Ace-Tang <[email protected]>
|
CI do not like add the Deprecated field |
| // in https://github.com/moby/moby/blob/master/pkg/archive/archive.go, moby still use 'Xattrs' | ||
| // to deal with file extended attributes, maybe other image build tools also do this way. | ||
| // Add resolve file attributes from 'hdr.Xattrs' make these images work good | ||
| for key, value := range hdr.Xattrs { |
There was a problem hiding this comment.
I think we can close this PR. As @dmcgowan mentions, the hdr.Xattrs has been deprecated.
In > go1.10 version, I read the code in golang code base. The PAXRecords will contains all values in hdr.Xattrs. please check this https://github.com/golang/go/blob/50bd1c4d4eb4fac8ddeb5f063c099daccfb71b26/src/archive/tar/reader.go#L249
If I understand correctly, after go1.10, user can retrieve the SCHILY.xattr. value from PAXRecords. PAXRecords can provides unify entrypoint to user.
|
@fuweid , you are right, I check the golang 1.10 release note, https://golang.org/doc/go1.10#archive/tar
|
Through golang indicate that tar header field 'Xattrs' should be Deprecated,
but moby still use 'Xattrs' to deal with file extended attributes, maybe
other image build tools also do this way. Add resolve file attributes from
'hdr.Xattrs' make these images work good, let extended file take effect.
Fixes: #2863
Signed-off-by: Ace-Tang [email protected]
I am trying to add a test for
file xattrs