-
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
Allow tarfiles to be built without --destination #669
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
…with no --destination
5539546
to
b7efbd0
Compare
@@ -101,6 +101,12 @@ func DoPush(image v1.Image, opts *config.KanikoOptions) error { | |||
} | |||
|
|||
if opts.TarPath != "" { | |||
destRef, err := name.NewTag("temp/tag", name.WeakValidation) |
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.
Sorry for a late review, you shd check if there is no destination
is provided.
To add some more clarity, the command succeeds without the |
Apologies, I forgot this existed entirely, and never ended up using Kaniko due to this and other issues. Totally happy for someone to take over this change (code and all) and push it through, modify it or whatever. |
Fixes #572 .
This uses the same hack as in build.go:576 of adding a dummy destination tag to the image, to ensure that a tarfile can be built without having to provide your own fake
--destination
flag.I'm sure there's a neater way than this, but haven't wrapped my head around the codebase yet. Happy for a proper fix rather than this hack if you know a better way.
You can see the before / after results of this change in the
debug
container by using the following script:Before this PR:
Test 1
has only a manifest.json file with the contentsnull
.After this PR:
Expected Output:
Both
Test 1
andTest 3
should generate a tarfile with valid layer contents, in this case a/test.txt
file.