Thanks for taking the time to join our community and start contributing!
Please remember to read and observe the Code of Conduct.
All dependencies of this project are expressed in its package.json file. Before you start developing, ensure that you have NPM installed, then run:
npm install- Fork this repo
- Create a feature branch
- Make your changes (see sections below for development guidelines)
- Test your changes (
npm test) - Ensure code is formatted (
npm run format) and passes linting (npm run lint) - Submit a pull request
We'd love to accept your patches! Before we can accept them you need to sign the Cloud Native Computing Foundation (CNCF) CLA.
If you have any problem with the package or any suggestions, please file an issue.
- Submit an issue describing your proposed change to the repo
- Fork this repo, develop and test your code changes
- Submit a pull request
- The bot will automatically assign someone to review your PR. Check the full list of bot commands here
For more detailed guidance, see the Kubernetes contributor guide.
This repo is built around a core of generated code that lives in the /src/gen directory
The /src/gen folder's contents is generated using the OpenAPI Generator. This code should not be modified manually as changes will be overwritten by the generator.
- Generator: Uses OpenAPI Generator with TypeScript configuration
- Spec Source: Pulls from the Kubernetes OpenAPI Spec
- Configuration: Shared config at kubernetes-client/gen
- Settings: Generation inputs are configured in the
/settingsfile
Around the core generated code in src/gen, the client layer adds Kubernetes-specific features:
- Kubeconfig authentication
- Watch functionality
- Serialization
- Higher-level ergonomics requiring multiple REST calls
These functionalities provide parity with kubectl and expose convenient abstractions. For example, kubectl port-forward deploy/my-deployment doesn't POST to a .../deployments/... route. Instead, a pod is selected via listing and filtering, then a POST to .../pods/.../portforward is sent.
If improvements require changes to the generated code:
- Raise the issue upstream in the OpenAPIGenerator repo
- After they merge, update the sha in
/settings - Regenerate the project using
npm run generate
Many changes can be made using middleware to access or conditionally mutate requests without modifying the generator.
npm run generateDocumentation is generated via typedoc:
npm run docsTo view the generated documentation, open docs/index.html
Run npm run format or install an editor plugin like:
Run npm run lint or install an editor plugin.
Tests are written using the node:test test runner and node:assert assertion library. See config_test.ts for an example.
To run tests:
npm testYou can reach the maintainers of this project at:
- SIG API Machinery
- #kubernetes-client channel on Kubernetes Slack