Fixes #322: Add support for lists in ignore_changes_to #324
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.
Summary
Enhanced the
getDelta
function to support ignoreList functionality when comparing slices containing map elements. Previously, slice comparisons only supported ignoring the entire slice or performed simple deep equality checks. Now, specific fields within slice elements can be ignored using dot notation.Key Changes
Core Implementation
getDelta
: Modified slice comparison logic to support ignoreList for map elements within slicescompareSlicesWithIgnoreListReflection
: New function using Go's reflection package to handle different slice types ([]map[string]interface{}
,[]interface{}
, etc.) while preserving type information_descendIgnoreList
bug: Corrected array pre-allocation + append issue that was creating empty entries in ignore listsBehavior & Rules
list.field
syntax to ignorefield
in all elements oflist
Enhanced Testing
list.val
ignoresval
field in all list elements)TestHasDeltaModifiedResource
: Added slice with ignoreList to existing test to validate complete functionalityExamples
Before (not supported)
After (now supported)