-
Notifications
You must be signed in to change notification settings - Fork 27
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
local.Command not re-running on changing inputs #37
Comments
This seems by design as per https://github.com/pulumi/pulumi-command/blob/master/provider/pkg/provider/provider.go#L278. Once could trigger an update by specifying a replaceOnChanges clause for environment etc. cc @lukehoban if this seems worth doing by default or if there is a good use case to consider offering an update hook in addition. |
Per the discussion in Slack: https://pulumi-community.slack.com/archives/C84L4E3N1/p1643048823205900 It looks like In general, this is very unintuitive that nothing we changed on the Finally, I will note that it's unfortunate there is no way to do an update, as it forces deleting the entire resource and re-creating. In the example of managing an external resource using One example of this is imagine you want to create a GitHub group (similar to the GitHub label example), and that GithubGroup resource has a name and a description. Additionally, you can manage who is in that group (but that's done as a separate activity, possibly outside of Pulumi). Say you wanted to update the description: with the "replace" semantics (i.e. do a delete and then a create), it would delete the entire group and recreate it, which would mean all the members of that group get removed. If there was an update, it would be possible to just update the description. I know it'll be more difficult to do so without having some kind of diff semantics, but the developer can handle it however they want. |
I believe this is largely the same issue tracked in #20, about adding the ability to have actions be taken during "updates" (which also will require the ability to determine what changes constitute an update). For many use cases, there is no meaningful interpretation of an update (for example, for provisioning scenarios, and for anything that could be accomplished with Terrraform style provisioners). But it is definitely true that there are scenarios for a The key question related to #20 is to figure out how |
Thanks @lukehoban - happy to have this ticket closed in favor of #20 if that's easier. How can I help to get the improvement here? Specifically, I want to use this to create a "fake package" for a set of resources, as creating a real Pulumi package is such a heavy lift at the moment. |
The same thing happens with remote commands, e.g. copy file. If you have a copy file operation from local to remote, then change either the local file or the remote file (even if you delete the remote file), no copy happens until you destroy the whole resource. There should be a simple, intuitive way to achieve the behavior many (most?) people would expect. |
I've found a work around for some use cases for this, by storing the This is extremely non-intuitive. I imagine pretty much everyone would expect it to re-run the command if the command changed. |
Cannot close issue without required labels: |
Hello!
Issue details
I'm trying a relatively simple usage (similar to the GithubLabels example), but it's not really working as I expected. This is using Go and v0.0.3 of local.Command.
Here is my
main.go
:Here is my
create.sh
anddestroy.sh
:When I run
pulumi up
the first time, the resource gets created and I see the right entry in the log file. Similarly, if I explicitly runpulumi destroy
, I see the right entry added to the log file.However, if I were to change the value (e.g. changing
"bar"
to"bar2"
), and I runpulumi up
, it tells me thatenvironment
is updated, but the script never executes again (and no corresponding entry in the log).Not sure if I'm doing something wrong or have the wrong expectations.
Steps to reproduce
See above.
Expected: Script re-runs when the inputs change.
Actual: Script doesn't re-run.
The text was updated successfully, but these errors were encountered: