Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relates to #2201, but it's not exactly the same issue, since this PR addresses the error during reading of the extended attributes, not the writing:
This happened on DigitalOcean App Platform, where Kaniko was running with minimal capabilities (and this cannot be relaxed.)
Output of
capsh --print
Description
This PR checks
EBADF
errno when the call tolgetxattr
fails. This seems to fail in some environments with missing capabilities. Ignoring the error (and skipping the xattr) is better than aborting or ignoring the file completely (which is the workaround posted in #2201)This is not easy to test in unit/integration tests, but I've verified the fix works with a project that kept failing with the error mentioned in #2201: trying run Kaniko in a Digital Ocean App building this project: https://github.com/DefangLabs/samples/tree/main/samples/flask
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Reviewer Notes
Release Notes
Describe any changes here so maintainer can include it in the release notes, or delete this block.