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
Copy link
Member Author

cc @tonistiigi

@AkihiroSuda
Copy link
Member Author

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 November 21, 2018 11:27
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

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

@nixpanic Thanks, cherry-picked your commit

@AkihiroSuda
Copy link
Member Author

@dmcgowan @cpuguy83 PTAL?

@cpuguy83
Copy link
Member

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

@cpuguy83
Copy link
Member

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

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

Copy link
Contributor

@nixpanic nixpanic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

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

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

Choose a reason for hiding this comment

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

see comment

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

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