Skip to content

Nested XR identity not preserved during diff #144

@jcogilvie

Description

@jcogilvie

Expected behavior:

  • Nested XRs should be matched to their existing cluster instances by crossplane.io/composition-resource-name
    annotation
  • Existing nested XR names and crossplane.io/composite labels should be preserved
  • Managed resources owned by nested XRs should correctly show as unchanged (or show actual modifications if
    changed)

Actual behavior:

  • Nested XRs are treated as new resources with generated names
  • All managed resources owned by nested XRs appear with "---" (removed) and "+++" (added) markers
  • The diff shows dozens/hundreds of resources being replaced when they should be unchanged
  • Nested XR names display with "(generated)" suffix instead of their actual cluster names

How can we reproduce it?

  1. Create a composition that produces nested XRs (an XR that creates other XRs as composed resources)
  2. Apply an XR or Claim using this composition to a cluster with Crossplane installed
  3. Wait for all resources to become available
  4. Modify the parent XR/Claim in any way (e.g., add labels, change a field value)
  5. Run crossplane-diff xr modified-xr.yaml

Observed: Diff shows all nested managed resources as removed/re-added
Expected: Diff correctly identifies nested XRs and shows only actual changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions