-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ADD with https in URL treated as file #1590
Comments
Any updates on this? |
Would be great if anyone of the project owners could comment on this. I think this a major issue. |
Ran into the same problem while trying to migrate a codebase to kaniko today so this is definitely still an issue. |
I had a similar issue where adding a file from URL did not work for me. This is actually supported by kaniko, but the URL must be valid and accessible from where kaniko is running. Took me a while to find, but in my case the function below was burying an SSL validation error on the URL I was trying to add. Fixed by appending my custom CA to kaniko/pkg/util/command_util.go Line 285 in cf9a334
|
Thanks for flagging this, can anyone in the thread here clarify if the workaround/fix @anguswilliams mentioned worked for them as well? Currently not clear if this is a kaniko bug requiring code change/fix or the use cases mentioned here are supported by kaniko but require additional documentation and/or better UX |
@aaron-prindle it's a valid error, but it could be logged better. I think it could do with some UX improvement as it's hard to tell what's actually going on if you hit the specific scenario. Two options I can think of:
In my mind the second option is best, as it looks like that function is just trying to validate the source file is a URL or not. It's basically double handling that file. Happy to submit a PR to fix. |
Ah I see, thank you for the additional context there @anguswilliams. +1, I think the second option looks best as well- that would be great if you could submit a PR with the fix! |
`IsSrcRemoteFileURL` was doing a `http.Get` call to make sure the URL was valid, but not surfacing any errors. Because the error from the http.Get call is not handled, some useful information can be buried. It also means kaniko will download the file twice during a build, once to validate, and once to actually add the file to the image. Removing the http.Get call and validating the URL is valid, and has the correct schema and hostname will stop the double handling, and allow any errors to be surfaced through the error handing in the file download function. Fixes GoogleContainerTools#1590 Signed-off-by: Angus Williams <anguswilliams@gmail.com>
`IsSrcRemoteFileURL` was doing a `http.Get` call to make sure the URL was valid, but not surfacing any errors. Because the error from the http.Get call is not handled, some useful information can be buried. It also means kaniko will download the file twice during a build, once to validate, and once to actually add the file to the image. Removing the http.Get call and validating the URL is valid, and has the correct schema and hostname will stop the double handling, and allow any errors to be surfaced through the error handing in the file download function. Fixes GoogleContainerTools#1590 Signed-off-by: Angus Williams <anguswilliams@gmail.com>
`IsSrcRemoteFileURL` was doing a `http.Get` call to make sure the URL was valid, but not surfacing any errors. Because the error from the http.Get call is not handled, some useful information can be buried. It also means kaniko will download the file twice during a build, once to validate, and once to actually add the file to the image. Removing the http.Get call and validating the URL is valid, and has the correct schema and hostname will stop the double handling, and allow any errors to be surfaced through the error handing in the file download function. Fixes #1590 Signed-off-by: Angus Williams <anguswilliams@gmail.com>
…eContainerTools#2563) `IsSrcRemoteFileURL` was doing a `http.Get` call to make sure the URL was valid, but not surfacing any errors. Because the error from the http.Get call is not handled, some useful information can be buried. It also means kaniko will download the file twice during a build, once to validate, and once to actually add the file to the image. Removing the http.Get call and validating the URL is valid, and has the correct schema and hostname will stop the double handling, and allow any errors to be surfaced through the error handing in the file download function. Fixes GoogleContainerTools#1590 Signed-off-by: Angus Williams <anguswilliams@gmail.com>
Actual behavior
using
ADD
withhttps
in URL is treated like file in context instead of URL.Expected behavior
Using
http
in URL is working,https
in URL should work the same way.To Reproduce
Steps to reproduce the behavior:
Additional Information
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: