pulumi: Previews do not reflect the resulting update
When running up, the preview is vastly different than the resulting update. For example, making a change to an annotation in a namespace is causing all resources that use that namespace to be previewed as needing a replacement.
In my particular example here we’re using the Kubernetes provider, but I’ve experienced this with GCP’s Cloud SQL and other resources as well.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (15 by maintainers)
Commits related to this issue
- Propagate inputs to outputs during preview. These changes restore a more-correct version of the behavior that was disabled with #3014. The original implementation of this behavior was done in the SDK... — committed to pulumi/pulumi by pgavlin 5 years ago
- Propagate inputs to outputs during preview. These changes restore a more-correct version of the behavior that was disabled with #3014. The original implementation of this behavior was done in the SDK... — committed to pulumi/pulumi by pgavlin 5 years ago
- Propagate inputs to outputs during preview. These changes restore a more-correct version of the behavior that was disabled with #3014. The original implementation of this behavior was done in the SDK... — committed to pulumi/pulumi by pgavlin 5 years ago
- Propagate inputs to outputs during preview. (#3245) These changes restore a more-correct version of the behavior that was disabled with #3014. The original implementation of this behavior was done ... — committed to pulumi/pulumi by pgavlin 5 years ago
- Propagate inputs to outputs during preview. These changes restore a more-correct version of the behavior that was disabled with #3014. The original implementation of this behavior was done in the SDK... — committed to pulumi/pulumi by pgavlin 5 years ago
- Propagate inputs to outputs during preview. These changes restore a more-correct version of the behavior that was disabled with #3014. The original implementation of this behavior was done in the SDK... — committed to pulumi/pulumi by pgavlin 5 years ago
- Propagate inputs to outputs during preview. (#3327) These changes restore a more-correct version of the behavior that was disabled with #3014. The original implementation of this behavior was done ... — committed to pulumi/pulumi by pgavlin 5 years ago
Just to include a few more details here - here’s a short repro:
If the above is deployed, and then the annotation is commented back in, a
pulumi preview --diffwill show:This suggested “replace” of the Pod is clearly very bad. It’s conservative, but makes the preview something you can’t trust anymore. The formatting of the diff on the
Podis also confusing (it says the namespace is being removed - which it isn’t).As noted above - one current workaround is to use
PULUMI_ENABLE_LEGACY_APPLYwhich will produce:But we also need to ensure that the default experience is not overly conservative here and that preview remains useful in these cases.
The core to this is in passing back the information that
namespace.metadata.nameis “stable” - that is, immutable for a given namespace. I was sure we had an issue tracking this already - but for now we can use this issue to track this improvement that we want to make soon to improve the default experience here (without regressing the fundamental safety of previews).@pgavlin That would be my preference. I would expect preview to be a dry run, thus returning exactly the values that it would create. In fact, my personal opinion would be that the update should execute exactly what is done via the preview. Thus it shouldn’t recalculate twice. It already knows what it needs to do, and should execute those changes. But that’s just my opinion as a user.