Skip to content

[sdkv2] ignoreChanges with wildcards (*) are not processedΒ #3177

@corymhall

Description

@corymhall

What happened?

I created some tests in this PR to show the issue. When the ignoreChanges option contains a wildcard (applies to lists, sets, and maps) the ignoreChanges is ignored by the bridge.

The code responsible is located here

This leads me to believe that the ignoreChanges logic is not needed in the bridge and we can rely on the ignoreChanges logic in core.

The current flow of ignoreChanges looks something like this:

  1. Resource created with a property items with an initial value and ignoreChanges: ['items[*].weight']
{ "items": [{"weight": 100}, {"weight": 200}] }
  1. Value changed to be
{ "items": [{"weight": 300}, {"weight": 200}] }
  1. core processes ignoreChanges and passes the old inputs to Check
{ "items": [{"weight": 100}, {"weight": 200}] }
  1. bridge runs the Terraform plan and if there is a plan where there is a diff due to items[*].weight it will delete that from the plan. In this case since core reset the values, there will not be a diff.

Example

See examples in linked PR.

Output of pulumi about

NA

Additional context

For future reference, if we ever think we need to update something related to ignoreChanges in the bridge, we should first see if it can be fixed in core. We currently think there are cases that can't be fixed in core, but they are not enumerated anywhere.

If we want to try and remove ignoreChanges logic from the bridge we will need a test suite that compares with/without.

related to:
pulumi/pulumi#20447
pulumi/pulumi-aws#5798

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSome behavior is incorrect or out of spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions