-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EP-10498: Deflate repository into idiomatic Go layout #10566
base: main
Are you sure you want to change the base?
Add EP-10498: Deflate repository into idiomatic Go layout #10566
Conversation
Signed-off-by: timflannagan <[email protected]>
- Separate the project's Go applications by extracting existing CLI entry points (currently nested in `projects/*/cmd` subdirectories) into a top-level `cmd/` directory, in order to follow standard Go patterns. | ||
- Standardize tooling placement by ensuring all project-specific tooling, miscellaneous scripts, and other automation-related files reside in a `hack/` directory. | ||
|
||
## Non-Goals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Add non-goal for separate kgateway/api repository to make it easier for consumers to import that module without the rest of the kgateway module dependencies. This can be done over time if strictly necessary.
$ tree -L 1 | ||
├── api/ # Migrated from `projects/gateway2/api/...` initially. Any future API types will be added here. | ||
├── cmd/ # Top-level directory containing main entry points (e.g., cmd/sds, cmd/controller, cmd/envoy-init, etc.). | ||
├── internal/ # Private application and library code that is not meant to be imported by external consumers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, i think it makes sense that most code would live here. that way we know we can change it without breaking downstream clients
|
||
```bash | ||
$ tree -L 1 | ||
├── api/ # Migrated from `projects/gateway2/api/...` initially. Any future API types will be added here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've seen projects use the plural form apis
because often you have more than one (i.e. v1alpha1
, v1beta1
, etc..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I've seen a combination of api, apis, and pkg/api(s) throughout the ecosystem. I tend to prefer the first two unless the project adopted the pkg/apis organization as k8s tooling matured.
|
||
To minimize disruption, we will perform this restructuring in a single or minimal number of pull requests. The process will include updating import paths, adjusting CI and build scripts, and ensuring that all automated tests pass. Documentation will be updated to reflect the new structure, and contributors will be provided with migration guidance for adapting to the changes. | ||
|
||
### Proposed Directory Layout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: design/ & examples/ directories too? For the latter, we'd move the projects/gateway2/examples to the root.
TODO: what to do about projects/distroless going forward. |
Description
Add an enhancement for deflating the current repository structure (notable the projects/ directory) into a flatter organization. Implementation will follow if accepted.
Related to #10496.
Related to #10498.
Checklist: