Open jan-hudec opened 1 week ago
Sorry to hear you're experiencing this issue. I am unable to reproduce this issue with Pulumi CLI v3.122.0
and pulumi-kubernetes v4.12.0
.
After a refresh event, my local state updates accurately to show that the deployment has been deleted on the cluster. Running pulumi up --refresh
and pulumi refresh
both correctly update the local state without errors, allowing the deployment to be recreated.
If the local state isn't refreshed to reflect the out-of-band deletion of the on-cluster deployment, it's expected that the preview would fail with the error you mentioned. This is because, by default, we perform a server-side dry-run during previews, which would fail in this case.
It seems the root issue here is that your state isn't being updated correctly. Before transferring this issue to pu/pu, could you please provide a minimal code reproduction to ensure I fully understand the problem you're facing?
Thanks!
What happened?
After a failed deployment that involved re-creating some deployments, I'm getting errors like:
This error happens with both
pulumi up
andpulumi up --refresh
, whilepulumi refresh
alone does not produce it, but does not fix the state either.This is a combination of two issues:
delete_before_replace=true
in resource options and in the previousup
the delete was performed, but the create was not, because some other resource failed with a spurious error in the meantime, and this fact was apparently not properly recorded in the state.Example
pulumi refresh
, or re-create it withpulumi up --refresh
.Output of
pulumi about
Additional context
The state-mishandling part due to which it happened to me (already a second time) is probably an issue in pulumi itself, but the kubernetes plugin should still be able to correctly record that something disappeared from the server rather than fail.
This is different from the
delete_unreachable
andskip_update_unreachable
options of the provider as documented, because the cluster is reachable just fine, just something else (either pulumi error or unrelated process) deleted the resources from it, while those options are documented as related to the cluster itself being unreachable.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).