-
Notifications
You must be signed in to change notification settings - Fork 2
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
build-on-preview
skips if push
is true
#252
Comments
It seems like I can get around it by explicitly specifying the exports and disabling push by default.
This runs the build on preview and publishes the image when running |
Thanks for filing this @bandreit! We'll look into this. |
This problem is seriously hampering my usage of the I could try to create PR as well, but I am actually not even sure how to fix the problem described in this issue. Some patch to add flag to |
Actually, the more I think about it, the more I am leaning towards this kind of approach:
// Exported by @pulumi/docker-build package
function push(
args: types.input.ExportRegistryArgs = {},
): docker.types.input.ExportArgs {
return {
registry: args,
};
}
function load(
args: types.input.ExportDockerArgs = {},
): docker.types.input.ExportArgs {
return {
docker: args,
};
} // Used in client code
import * as docker from "@pulumi/docker-build";
new docker.Image("...", {
exports: [
docker.push(),
docker.load()
],
...
}); I think (I admit tho that I haven't looked closely at the codebase) this would remove a lot of edgecase-related plumbing code from the provider, and would be more explicit towards the users of the provider. WDYT? |
Unfortunately now that they're already there we can't take them out, as we try to stay as backwards-compatible as possible. We can make For some background these helpers were initially omitted, partly because of the confusing behavior you're running into here. There were concerns the API would be too unfriendly if users had to explicitly configure every export (which isn't wrong!) so the helpers were added. Opinions were split on whether to require the
|
Ah, it makes sense now with some history behind it explained, thanks for shedding the light on it. :)
I can not speak for all of the users of this provider for sure, but at least for me, when the version is beginning with But making |
What happened?
I am mostly trying to replicate the set-up from the docs for pushing to ECR with caching.
The image fails to build on preview with the following warning:
The reason apparently can be tracked down to the checks that are performed before establishing if build-on-preview is to pe performed.
The deep-equality check performed here fails because of the normalization. Because the push flag is true, the normalization function adds the Exports config - causing an obvious difference in the deep-equality check that follows.
Example
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: