engine: add flag to disable push on custom build#1341
Conversation
| _, err := f.ibd.BuildAndDeploy(f.ctx, f.st, buildTargets(manifest), store.BuildStateSet{}) | ||
| // the image doesn't exist, so the custom build fails | ||
| // TODO(dmiller): change this test to use the static tag parameter when that's added | ||
| assert.Error(t, err) |
There was a problem hiding this comment.
can you add an assertion that this is the error you expect, and not some other error?
There was a problem hiding this comment.
Yes, but I probably should have made this more clear: this test doesn't do anything at the moment because the tag is generated by the build and deployer and I can't know what it is to inject it in to the fake docker client.
Thus the TODO to change this test to use the static tag parameter that @maiamcc is going to add. So really this is more of a stub, and once that parameter is added I can inject the static image tag in to the fake docker client and the build and deployer won't return an error at all.
maiamcc
left a comment
There was a problem hiding this comment.
lgtm. i apologize in advance for the merge conflicts.
| if iTarget.IsCustomBuild() { | ||
| cbSkip = iTarget.CustomBuildInfo().DisablePush | ||
| } | ||
|
|
There was a problem hiding this comment.
tbh you could just to cbSkip := iTarget.CustomBuildInfo().DisablePush (or even take all this out and in the conditional below, just put iTarget.CustomBuildInfo().DisablePush)
There was a problem hiding this comment.
Couldn't it be nil though?
There was a problem hiding this comment.
Nah, if it's not a custom build, this func returns an EMPTY CustomBuild (not a nil one). though i guess you're right that that's maybe not functionality we want to rely on...?
|
@maiamcc no worries, I'll wait for you to merge yours in and then resolve the conflicts over here. :D |
|
k, it's merged! glhfdd. |
900f80e to
00f0e63
Compare
@rohansingh needs this for his bazel + KIND setup. For the moment bazel is much better at doing the layer negotiation and pushing only what is necessary.
kind loadis less efficient. @rohansingh has a workaround where he tees the image to both docker and KIND, allowing custom_build to verify that the image was created correctly and allowing KIND to get the image in a fast way. What he needs is a way to disable the image push in this case.I decided to add this as a flag to
custom_buildbecause its a pretty special case, only is used fromcustom_buildsright now and fits in withcustom_build's evolving, experimental API.