Skip to content

Commit

Permalink
Resolve dependencies to untagged contexts only
Browse files Browse the repository at this point in the history
When looking for dependency sources/targets, we match only contexts
with null tag. This restores the behavior of midPoint 4.5 and earlier,
and gives more determinism to the processing.
  • Loading branch information
mederly committed Jun 9, 2022
1 parent 36650b9 commit 9feca71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1812,6 +1812,10 @@ public int getOrder() {
return key.getOrder();
}

public String getTag() {
return key.getTag();
}

/** Use with care! */
@Experimental
public boolean isDefaultForKind(@NotNull ShadowKindType kind) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ private LensProjectionContext findFirstUpstreamContext(
public static boolean matches(LensProjectionContext ctx, ResourceObjectTypeDependencyType dependency) {
return getResourceOidRequired(dependency).equals(ctx.getResourceOid())
&& getKindRequired(dependency) == ctx.getKind()
&& intentMatches(ctx, dependency);
&& intentMatches(ctx, dependency)
&& ctx.getTag() == null; // This is how it was before 4.6.
}

private static boolean intentMatches(LensProjectionContext ctx, ResourceObjectTypeDependencyType dependency) {
Expand Down

0 comments on commit 9feca71

Please sign in to comment.