-
Notifications
You must be signed in to change notification settings - Fork 17
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
An Update can cause a Delete #362
Comments
The "diff" for We can see in the logs that
The result is that the diff doesn't indicate any replacement to Pulumi's planning engine, but then the Update that gets computed includes a diff that forces replacement. |
So - root cause of this is the following two lines in the Pulumi engine:
Note that for "olds" - we pass only the old outputs to Diff, but we pass a merge of old inputs and old outputs to Subtly - the call to
@swgillespie What are the expected semantics here? I assume we have to present the same values to
|
If the computed diff requires replacement, the contract with the Pulumi provider model has been violated. We should avoid progressing and doing deletes in this case. Related to #362.
If the computed diff requires replacement, the contract with the Pulumi provider model has been violated. We should avoid progressing and doing deletes in this case. Related to #362.
The core issue is fixed with #363. It will no longer be possible to unintentionally trigger a delete. However, it will now be an assert instead. Ultimately, we will have to somehow reconcile the core resource model issues here with using outputs in some places and merged inputs+outputs in other places. I've opened pulumi/pulumi#2650 to track that - but it is not as critical as we've patched the most significant failure mode this can trigger. |
We have seen a case where calling
Update
on atfbridge
-based Pulumi provider can lead to invoking aDelete
on the underlying Terraform provider.The repro (below) is unfortunately complex, but the result is that we see the following update (note this is not a replace or delete):
But the following logs in the provider:
And indeed - from our
Update
logic inpulumi-terraform
there is a path to this code which calls theDelete
on the underlying provider.https://github.com/pulumi/pulumi-terraform/blob/788550dffb09eff703d3ee8fb27d4d163cbb7211/vendor/github.com/hashicorp/terraform/helper/schema/resource.go#L258-L264
It appears that somehow, we can construct a
Diff
object for an update which hasd.Destroy || d.RequiresNew()
.Repro:
Deploy that then:
nodeIpv4CidrBlock: "10.174.56.0/22",
toipAllocationPolicy
(getting the correct value to set from the outputs of the currently deployed cluster.pulumi update
The text was updated successfully, but these errors were encountered: