Skip to content

[281#4] fix(exporter): strip Crossplane default labels from exported CF resources#290

Closed
mpechkurov wants to merge 2 commits into
feat/metadata-packagefrom
fix/exporter-strip-labels
Closed

[281#4] fix(exporter): strip Crossplane default labels from exported CF resources#290
mpechkurov wants to merge 2 commits into
feat/metadata-packagefrom
fix/exporter-strip-labels

Conversation

@mpechkurov
Copy link
Copy Markdown
Collaborator

What

  • New cmd/exporter/cf/metadata/metadata.go with StripDefaultLabels helper
  • Strip crossplane-kind, crossplane-name, crossplane-providerconfig from exported CR manifests
  • Fix import grouping in exporter convert files (goimports convention)

Why

Default labels are infrastructure metadata computed by the controller from the CR identity. They are semantically incorrect for a new/exported CR (different name, different ProviderConfig) and the controller will recompute them on the next reconcile.

Part of

Split from #281 — PR 4 of 6. Depends on [281#1] only (can be merged independently of [281#2] and [281#3]).

Merge order: [281#1] → [281#2] → [281#3] → [281#4] → [281#5] → [281#6]

…rces

Add metadata.StripDefaultLabels() to remove crossplane-kind,
crossplane-name, and crossplane-provider-config labels from CF
resource metadata before writing exported CR manifests. These labels
are infrastructure metadata computed by the controller and should not
appear in ForProvider specs — a new CR gets different values and the
controller recomputes them on reconcile.

- New: cmd/exporter/cf/metadata/metadata.go — StripDefaultLabels helper
- Updated app, org, serviceinstance, and space exporters
- App exporter also gains previously missing ResourceMetadata block
- Group metadata import with other crossplane-provider-cloudfoundry
  imports in exporter convert files (goimports convention)
- Remove json.MarshalIndent debug logging from SRB e2e test poll loop
@SatabdiG
Copy link
Copy Markdown
Collaborator

Closing as #281 received review comments.

@SatabdiG SatabdiG closed this May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants