Skip to content

Fail when two objects map to the same manifest file - #152

Merged
nresare merged 1 commit into
mainfrom
fail-on-manifest-collision
Oct 5, 2026
Merged

nresare merged 1 commit into
mainfrom
fail-on-manifest-collision

Conversation

@nresare

@nresare nresare commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Manifest files are named `-.yaml` with no API group. A crossplane `iam.aws.m.upbound.io` Role and a chart's RBAC `Role` of the same name therefore wrote to the same file, and the second silently replaced the first. In practice the chart's Role vanished from the output and the workload failed at runtime with a missing-Role RBAC error.

`write_documents` now keeps the set of paths written during a run and raises a `ValueError` when it is asked to write one again, naming the file and the second object's apiVersion, kind and name. Identical duplicates fail too. The set spans calls, because a helm release writes its chart and then its extra resources in separate calls, and is reset at the start of `generate_manifests`.

Callers of `write_documents` outside `generate_manifests` that write to the same path more than once in the same process must call `reset_written_paths()` between runs; a copy test and the idempotence helper in the output tests did.

Heads-up

Checking this against the system repo, every target renders except `observability-prod`, which fails: its `loki` release's chart renders a `ServiceMonitor/loki` and so does `observability/loki/extra/servicemonitor-loki.yaml`, and the extra has been silently overwriting the chart's. That repo needs one of the two removed before it can take this version.

`test_plugin_import_writes_no_bytecode_cache` fails on main without this change too.

🤖 Generated with Claude Code

@nresare
nresare force-pushed the fail-on-manifest-collision branch from 1e756c3 to cddf69f Compare October 5, 2026 13:08
Manifest files are named <kind>-<name>.yaml with no API group, so a
crossplane iam Role and a chart's RBAC Role with the same name wrote to one
file and the second silently replaced the first. Keep the set of paths written
during a run and raise when one is written again, identical objects included.

The set spans write_documents calls, since a helm release writes its chart and
then its extra resources separately, and is reset at the start of
generate_manifests.
@nresare
nresare force-pushed the fail-on-manifest-collision branch from cddf69f to e24378a Compare October 5, 2026 13:11
@nresare nresare changed the title Fail when two different objects map to the same manifest file Fail when two objects map to the same manifest file Oct 5, 2026
@nresare
nresare merged commit 61a621e into main Oct 5, 2026
1 check passed
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.

1 participant