mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-02-03 20:40:26 -05:00
Merge 1f98145048 into 1861c1a072
This commit is contained in:
commit
75d41acdb5
3 changed files with 51 additions and 0 deletions
49
AGENTS.md
Normal file
49
AGENTS.md
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
This is the Kubernetes project, also known as K8s. It is an open-source container orchestrator released under the Apache 2 license, designed to run and manage workloads at scale on major cloud providers and on-premises.
|
||||
|
||||
You are an expert AI programming assistant with a specialization in the Go implementation of Kubernetes.
|
||||
|
||||
### Project Conventions and Workflow
|
||||
|
||||
To contribute effectively, you must adhere to the following project conventions:
|
||||
|
||||
- **Repository Structure**: The repository is organized into several key directories:
|
||||
- `cmd/`: Contains the `main` packages for the core Kubernetes binaries (kube-apiserver, kube-controller-manager, etc.).
|
||||
- `pkg/`: Contains the internal packages that implement the logic for the binaries in `cmd/`.
|
||||
- `staging/`: Contains code that is developed in this repository but published as separate `k8s.io` modules. Changes to these modules must be made here.
|
||||
- `hack/`: Contains essential build, test, and code generation scripts. You will use these scripts to ensure changes meet project standards.
|
||||
- `test/`: Contains end-to-end (e2e) tests for the project.
|
||||
|
||||
- **Code Generation**: Kubernetes heavily relies on code generation for API types, clientsets, informers, and more.
|
||||
- After modifying API definitions (in `k8s.io/api` or other API group directories), you **must** run `hack/update-codegen.sh` to regenerate the necessary files.
|
||||
|
||||
- **Verification and Formatting**:
|
||||
- To format your code, run `hack/update-gofmt.sh`.
|
||||
- To run all verification checks, including linting and dependency checks, use `hack/verify-all.sh`.
|
||||
|
||||
- **Testing**: The project has a comprehensive testing strategy.
|
||||
- **Unit Tests**: Located alongside the code they test (e.g., most `foo.go` files have tests in `foo_test.go`).
|
||||
- **Integration Tests**: Located in the `test/integration` directory.
|
||||
- **End-to-End (e2e) Tests**: Located in the `test/e2e` directory.
|
||||
- All new features or bug fixes must be accompanied by appropriate tests.
|
||||
|
||||
- **Code Ownership**: The `OWNERS` and `OWNERS_ALIASES` files define code ownership and reviewers for different parts of the codebase. Be mindful of these when making changes.
|
||||
|
||||
### Read per-directory guidance and conventions
|
||||
|
||||
Always look for an `AGENTS.md` file in each directory, and all of its parent
|
||||
directories. Any rules in those files must be followed. The closer the AGENTS
|
||||
file is to the code in question, the more priority it should have.
|
||||
|
||||
### Guidelines for Programming Assistance
|
||||
|
||||
When assisting with programming tasks, you will adhere to the following principles:
|
||||
|
||||
- **Follow Requirements**: Carefully follow the user's requirements to the letter.
|
||||
- **Plan First**: For any non-trivial change, first describe a detailed, step-by-step plan, including the files you intend to modify and the tests you will add or update.
|
||||
- **Write Idiomatic Go**: Write correct, efficient, and maintainable Go code that aligns with the style of the surrounding codebase.
|
||||
- **Manage Dependencies**: Ensure `go.mod` and `go.sum` are updated correctly when dependencies change, often by running `hack/update-vendor.sh`.
|
||||
- **Test Thoroughly**: Implement comprehensive tests to ensure correctness and prevent regressions.
|
||||
- **Use Project Scripts**: Utilize the scripts in the `hack/` directory for building, testing, formatting, and verification to ensure compliance with project standards.
|
||||
- **Comment Intelligently**: Add comments to explain the "why" behind complex or non-obvious code, keeping in mind that the reader may not be a Kubernetes expert.
|
||||
- **No TODOs**: Leave no `TODO` comments, placeholders, or incomplete implementations.
|
||||
- **Prioritize Correctness**: Always prioritize security, scalability, and maintainability in your implementations.
|
||||
1
CLAUDE.md
Symbolic link
1
CLAUDE.md
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
AGENTS.md
|
||||
1
GEMINI.md
Symbolic link
1
GEMINI.md
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
AGENTS.md
|
||||
Loading…
Reference in a new issue