-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix: kaniko dir env unused #2067
fix: kaniko dir env unused #2067
Conversation
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.
Otherwise LGTM! Is there a test that's reasonably easy to add for this? It's okay if not.
Co-authored-by: Jason Hall <jasonhall@redhat.com>
Will investigate the failing test, I believe the error on passing the I'll dig into this a bit further when I have some spare time. |
I've updated the description to reflect another underlying issue which surfaced after the change made in c04538d, which should be fixed from this PR, with some extra explanation. |
@imjasonh There's nothing that really springs to mind for a test in this case, the previous one that we created from the other PR passes and the Is there any sort of edge case which you can think of which we should cover? I may well be missing something here, but can't think of anything 😄 |
This seems not to work with non-root containers. Copying the specified directory to the default location won't work in this case, so we need a more comprehensive solution for the issue. It appears to my untrained eye that the problem is here because it uses the environment variable or the constant value, instead of the environment variable or the config value, and so on lines 37, 41, and 45, the |
I was able to partially work around the issue by specifying the alternate directory in both the environment variable and the command line flag, and by using a dev release of the image, however I now get I assume this is due to the kaniko/cmd/executor/cmd/root.go Line 259 in 323e616
|
Good morning, today I updated my dockerfile to run as root, and I was able to build the image without issue using Kaniko to build it because the /kaniko path is able to be deleted properly by the above code. I ran into other issues with the built image which appear to be unrelated to this pull request, so I'll open a new issue for that. |
Description
Relating to the comment made in #1997.
Previously, I made an oversight on what to be passed into the
checkKanikoDir
func, it was only the configuration option. Instead, it should have been a choice between the environment variable and the option. I have decided that the flag will take precedence, but this can easily be altered depending on any further discussion.There was also an underlying problem of seeing
file already exists
andinvalid cross-device link
errors after the above was fixed, this seems to have been addressed by utilising theCopyDir
func as part of theutils
package. This enables the moving of theKanikoDir
contents, regardless of whether it is destined for another partition or not.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.
Fixes the
kaniko-dir
flag, this now takes precedence over theKANIKO_DIR
environment variable.