Skip to content
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

fs: add WithAllowXAttrErrors CopyOpt #138

Merged
merged 3 commits into from Dec 3, 2018
Merged

Conversation

AkihiroSuda
Copy link
Member

@AkihiroSuda AkihiroSuda commented Oct 29, 2018

This option allows ignoring errors during copying xattr like security.selinux,
which is not always supported.

Reported in several issues including

Signed-off-by: Akihiro Suda suda.akihiro@lab.ntt.co.jp

@AkihiroSuda
Copy link
Member Author

@AkihiroSuda AkihiroSuda commented Oct 29, 2018

@AkihiroSuda
Copy link
Member Author

@AkihiroSuda AkihiroSuda commented Oct 30, 2018

So the PR appeared to have nothing to do with the buildkit failure but should be still useful

fs/copy.go Outdated Show resolved Hide resolved
AkihiroSuda and others added 2 commits Nov 21, 2018
This option allows ignoring errors during copying xattr like `security.selinux`,
which is not always supported.

Reported in several issues including
* openfaas/openfaas-cloud#312
* moby/buildkit#704
* genuinetools/img#45
* https://bugzilla.redhat.com/show_bug.cgi?id=1596918

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
@nixpanic
Copy link
Contributor

@nixpanic nixpanic commented Nov 21, 2018

Please consider this change on top of yours. It continues copying xattrs for a file, even if one of them fails (like security.selinux).

Feel free to incorporate the modification in an updated PR. Thanks!

@AkihiroSuda
Copy link
Member Author

@AkihiroSuda AkihiroSuda commented Nov 22, 2018

@nixpanic Thanks, cherry-picked your commit

@AkihiroSuda
Copy link
Member Author

@AkihiroSuda AkihiroSuda commented Nov 22, 2018

@cpuguy83
Copy link
Member

@cpuguy83 cpuguy83 commented Nov 22, 2018

Oh, nice!
Also related: moby/moby#38155

@cpuguy83
Copy link
Member

@cpuguy83 cpuguy83 commented Nov 22, 2018

I think for this case, being able to pass in an error handler on file copy would be handy.

Something like:

func(err error) error

Where if the handler wants to ignore the error it would return nil.

@AkihiroSuda
Copy link
Member Author

@AkihiroSuda AkihiroSuda commented Nov 22, 2018

Added type XAttrErrorHandler func(dst, src, xattrKey string, err error) error. PTAL.

Copy link
Contributor

@nixpanic nixpanic left a comment

LGTM, thanks!

nixpanic added a commit to nixpanic/external-storage that referenced this issue Nov 22, 2018
@nixpanic
Copy link
Contributor

@nixpanic nixpanic commented Nov 30, 2018

Hey guys, any progress with reviewing/merging? This PR works well for me and I'd like to see it included so that I can consume it in kubernetes-retired/external-storage#1013 and a future CSI driver.

Thanks!

fs/copy.go Outdated Show resolved Hide resolved
Copy link
Member

@mikebrow mikebrow left a comment

see comment

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
estesp
estesp approved these changes Dec 3, 2018
Copy link
Member

@estesp estesp left a comment

LGTM

@estesp estesp merged commit 004b464 into containerd:master Dec 3, 2018
1 check passed
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.

None yet

6 participants