Apply tagsAll PreCheckCallback to Plugin Framework resources to fix empty preview diffs - #6604
Closed
eon-pulumi-agent[bot] wants to merge 1 commit into
Closed
Apply tagsAll PreCheckCallback to Plugin Framework resources to fix empty preview diffs#6604eon-pulumi-agent[bot] wants to merge 1 commit into
eon-pulumi-agent[bot] wants to merge 1 commit into
Conversation
…iffs Plugin Framework resources (e.g. SecurityGroupIngressRule, SecurityGroupEgressRule) were excluded from the applyTagsPreCheckCallback that computes tagsAll at Check time. This caused pulumi preview to show these resources as '(update)' with an empty diff when defaultTags changed, even though the tags were actually being applied correctly on pulumi up. The fix extends the callback to all resources with HasTagsAndTagsAll, not just SDKv2 resources. For PF resources the upstream provider continues to handle the actual tag merge at apply time; the callback only ensures tagsAll is computed early enough to appear in the Check/Diff output so preview diffs are not empty. Fixes #6602
Contributor
Does the PR have any schema changes?Generated by schema-tools v0.8.1. Looking good! No breaking changes found. Maintainer note: consult the runbook for dealing with any breaking changes. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6604 +/- ##
=======================================
Coverage 15.84% 15.84%
=======================================
Files 376 376
Lines 92183 92183
=======================================
Hits 14608 14608
Misses 77554 77554
Partials 21 21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
See #6602 (comment) The correct fix is pulumi/pulumi-terraform-bridge#2281 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
SecurityGroupIngressRule,SecurityGroupEgressRule, and other Plugin Framework (PF) resources showed a spurious(update)with an empty diff duringpulumi preview --diffwhenaws:defaultTagswas changed. The tags were being applied correctly bypulumi up, but the preview output gave no indication of what would change.In contrast, SDKv2 resources like
NatGatewaycorrectly displayed thetagsAlldiff.Fixes #6602.
Root Cause
The
applyTagsPreCheckCallbackinprovider/tags.gocomputes the mergedtagsAllvalue atChecktime and stores it as a pseudo-input. This is what allows the Pulumi diff to displaytagsAllchanges during preview. Previously this callback was only applied to SDKv2 resources:PF resources were excluded with the reasoning that "upstream handles their tag behavior." While the upstream PF provider does correctly apply
tags_allduring Create/Update, it does not help with the Pulumi-side Check/Diff flow. Without the callback,tagsAllis not computed at Check time, so the Pulumi engine has nothing to diff against the prior state — resulting in an empty diff even though an update is triggered by the provider config change.Fix
Remove the SDKv2 gate so the callback is applied to all resources (both SDKv2 and PF) that have
hasTagsAndTagsAll:For PF resources, the upstream provider continues to handle the actual tag merge at apply time. The callback only adds early computation of
tagsAllat Check time, which is what makes the preview diff visible.Tests
TestTagsPreCheckCallbackAppliesOnlyToSDKV2Resources— updated to cover the SDKv2 case only (still passes)TestTagsPreCheckCallbackAppliesAlsoToPFResources— new test verifying PF resources now have the callback and produce correcttagsAlloutputAll existing provider tests pass.
Created with Eon