-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fix #1020: accessing GetRawPlan no longer panics #1033
Conversation
pkg/tests/regress_1020_test.go
Outdated
Elem: &schema.Schema{Type: schema.TypeString}, | ||
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { | ||
if d.GetRawPlan().IsNull() { | ||
panic(fmt.Sprintf("%s", "NULL GetRawPlan")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d.GetRawPlan() is null but should not be, therefore d.GetRawPlan().GetAttr("addresses") panics.
Digging further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1021 is probably related.
Diff for pulumi-random with merge commit d2b0f48 |
Diff for pulumi-azuread with merge commit d2b0f48 |
Diff for pulumi-gcp with merge commit d2b0f48 |
Diff for pulumi-azure with merge commit d2b0f48 |
Diff for pulumi-azuread with merge commit b5fae22 |
Diff for pulumi-random with merge commit b5fae22 |
Diff for pulumi-gcp with merge commit b5fae22 |
Diff for pulumi-azure with merge commit b5fae22 |
Diff for pulumi-random with merge commit 89826d3 |
Diff for pulumi-azuread with merge commit 89826d3 |
Diff for pulumi-gcp with merge commit 89826d3 |
Diff for pulumi-azure with merge commit 89826d3 |
Diff for pulumi-azuread with merge commit 4371d96 |
Diff for pulumi-random with merge commit 4371d96 |
Diff for pulumi-azuread with merge commit 1f14378 |
Diff for pulumi-random with merge commit 1f14378 |
Diff for pulumi-gcp with merge commit 4371d96 |
Diff for pulumi-gcp with merge commit 1f14378 |
Diff for pulumi-azure with merge commit 4371d96 |
Diff for pulumi-azure with merge commit 1f14378 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #1020
There was a problem with resources accessing GetRawPlan in DiffSuppressFunc; in Pulumi this plan was nil causing the provider to panic. TF CLI populates this plan via PlanState operation. Ultimately our plan is to do the same in Pulumi bridged providers, but that work is currently feature-flagged as we work through potential issues. For now a good workaround is to assume RawPlan=RawConfig instead of passing nil.
I've tested pulumi-aws built against this change and it is able to create, update and delete the affected resource without a panic.
Test program:
I will follow up with a separate PR duplicating the tests for the DiffStrategy=PlanState branch.