We welcome contributions to the cron-operator project! Whether you're fixing bugs, adding features, or improving documentation, your contributions help make this project better.
-
Prerequisites:
- Go version v1.24.6 or higher
- Docker version 17.03 or higher
- kubectl version v1.11.3 or higher
- Access to a Kubernetes cluster (v1.11.3+)
- Make utility installed
-
Clone the Repository:
git clone https://github.com/AliyunContainerService/cron-operator.git cd cron-operator -
Install Dependencies:
go mod download
-
Run Tests:
make test # Run unit tests make test-e2e # Run end-to-end tests
api/v1alpha1/: CRD type definitions and API specificationsinternal/controller/: Controller reconciliation logic and utilitiescmd/main.go: Application entry point and controller setupconfig/: Kubernetes manifests for CRDs, RBAC, and deploymenttest/: Unit tests and end-to-end test suitespkg/common/: Shared constants and utilities
-
Create a Feature Branch:
git checkout -b feature/your-feature-name
-
Make Your Changes:
- Write clean, well-documented code
- Follow existing code patterns and conventions
- Add tests for new functionality
- Update documentation as needed
-
Run Linters and Tests:
make lint # Run golangci-lint checks make test # Run unit tests
-
Commit Your Changes:
-
Use conventional commit format (e.g.,
feat:,fix:,docs:) -
Include DCO sign-off with
-sflag:git commit -s -m "feat: add new feature description" -
The sign-off certifies that you have the right to submit the code under the project's license
-
-
Push and Create Pull Request:
git push origin feature/your-feature-name
- Open a pull request against the
mainbranch - Provide a clear description of your changes
- Reference any related issues
- Open a pull request against the
-
Unit Tests: All new code should include unit tests with reasonable coverage
-
Integration Tests: Consider adding integration tests for controller logic in
internal/controller/*_test.go -
E2E Tests: For significant features, add end-to-end tests in
test/e2e/ -
Test Execution: Ensure all tests pass before submitting PR:
make test
- Follow Go best practices and idiomatic patterns
- Code must pass
golangci-lintchecks (see.golangci.yml) - Add meaningful comments for exported functions and types
- Use descriptive variable and function names
- Keep PRs focused on a single feature or fix
- Write clear PR titles following conventional commit format
- Include detailed description of changes and motivation
- Respond to review feedback promptly
- Ensure CI checks pass before requesting review
- Squash commits before merging if requested
If you have questions or need assistance:
- Open an issue for bug reports or feature requests
- Check existing issues and PRs for similar discussions
- Review the Kubebuilder Documentation for operator development patterns
Thank you for contributing to cron-operator!