Allow configurable apis/ folder structure to avoid path collisions
- Dominant language
- Go
- Stars
- 19
- Forks
- 31
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 52
Description
### What problem are you facing?
Generating APIs from an XRD or simple schema can conflict when two resources share the same kind but belong to different API groups. For example:
```
kubernetesclusters.onprem.example.com
kubernetesclusters.cloud.example.com
```
Both of these generate today into the same directory, `apis/kubernetesclusters/`, causing a conflict.
There is currently an option to specify the output path explicitly, but that doesn't scale for larger repositories or automated build tooling, where paths need to be derived consistently rather than set by hand.
### How could Crossplane help solve your problem?
Allow conflict-free generation of XRD definitions from an XR or simple schema. Ideas:
1. Add an option in `crossplane-project.yaml` to configure how the `apis/` folder is populated, using a template string such as `{{ groupElement[1] }}/{{ kindPlural }}`. For example, this would resolve to:
```
apis/
onprem/
kubernetesclusters/
definition.yaml
cloud/
kubernetesclusters/
definition.yaml
```
2. Default to a non-conflicting structure, similar to what `schemas/` already uses.
Contributor guide
Research direction
Start by tracing the CLI's existing explicit output-path option and comparing it with the non-conflicting schemas/ layout mentioned in the issue. Define how crossplane-project.yaml should configure the apis/ template and what the default should be; done means resources with the same kind but different API groups generate into distinct, deterministic directories.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100