Retire obsolete collection identity before replacement agreement
This commit is contained in:
@@ -220,9 +220,19 @@ func applyInheritanceScopeTemplates(adapter inheritanceScopeAdapter, order []int
|
||||
effectivePolicies := append(cloneInheritancePolicyTemplates(parentPolicies), cloneCollectionPolicyScopeForInheritance(templatePolicies))
|
||||
parentPolicyScope := projectInheritanceCollectionPolicies(resolvedPolicies[node.parent], node.path)
|
||||
childPolicyScope := projectCurrentInheritanceCollectionPolicies(templatePolicies, node.path)
|
||||
var replaced collectionReplacementPaths
|
||||
if len(parentPolicyScope.collections) != 0 || len(childPolicyScope.collections) != 0 {
|
||||
claims := compositionClaims{byPath: make(map[string][]compositionClaim)}
|
||||
claims.append(payload, node.path, 0)
|
||||
declarations := make(map[string][]sequenceDeclarationSpec, len(childPolicyScope.collections))
|
||||
for key, entry := range childPolicyScope.collections {
|
||||
declarations[key] = inheritanceDeclarationsAt(entry.destination, entry.policy)
|
||||
}
|
||||
parentPolicyScope, replaced = lowerCollectionPoliciesForClaims(parentPolicyScope, claims.ordered, declarations, adapter.applicationPolicy())
|
||||
}
|
||||
merged := inheritanceParentPayload(parent, node.identityFields)
|
||||
mergedPolicyScope, policyDiagnostics := mergeInheritanceCollectionPolicies(
|
||||
parentPolicyScope, childPolicyScope, node.path, parent, payload, adapter.applicationPolicy(),
|
||||
parentPolicyScope, childPolicyScope, node.path, parent, payload, adapter.applicationPolicy(), replaced,
|
||||
)
|
||||
if len(policyDiagnostics) != 0 {
|
||||
return nil, policyDiagnostics
|
||||
@@ -274,7 +284,7 @@ func applyInheritanceScopeTemplates(adapter inheritanceScopeAdapter, order []int
|
||||
return existing, false
|
||||
}
|
||||
policy := applyInheritanceSequencePolicy(
|
||||
childPath, combined, resolution, parentPolicyScope, childPolicyScope, &mergedPolicyScope,
|
||||
childPath, combined, resolution, parentPolicyScope, childPolicyScope,
|
||||
)
|
||||
mergedPolicyScope.set(childPath, policy)
|
||||
applyInheritanceSequenceOrigins(
|
||||
|
||||
Reference in New Issue
Block a user