Repository navigation
Fail when two objects map to the same manifest file - #152
Merged
Merged
Conversation
nresare
force-pushed
the
fail-on-manifest-collision
branch
from
October 5, 2026 13:08
1e756c3 to
cddf69f
Compare
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
force-pushed
the
fail-on-manifest-collision
branch
from
October 5, 2026 13:11
cddf69f to
e24378a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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