Contributing to PDB Operator
Thank you for your interest in contributing! This guide covers everything you need to get started.
Developer Certificate of Origin (DCO)
This project uses the Developer Certificate of Origin (DCO). All commit messages must contain the Signed-off-by line:
git commit -s -m "feat: add new feature"
If you forget, amend your last commit:
git commit --amend -s
Prerequisites
- Go 1.26+
- Docker or Podman
- kubectl
- operator-sdk v1.42+
- A Kubernetes cluster (kind, minikube, or remote)
- cert-manager (for webhook TLS)
Development Setup
- Fork and clone the repository:
git clone https://github.com/<your-username>/pdb-operator.git
cd pdb-operator
- Install dependencies and run tests:
go mod tidy
make test
make lint
- Build the operator:
make build
Local Development with Kind
# Create a local cluster
make kind-create
# Build and load the image
make docker-build kind-load-images
# Deploy the operator
make deploy
Making Changes
Branching
- Create a feature branch from
main - Use descriptive names:
feat/add-policy-validation,fix/pdb-reconciliation-race
Coding Standards
- Follow standard Go conventions
- Run
make lintbefore submitting - Add tests for new functionality
- Update documentation for user-facing changes
Commit Messages
Follow Conventional Commits:
feat:new featurefix:bug fixdocs:documentation changestest:adding or updating testsrefactor:code refactoringchore:maintenance tasks
Pull Request Process
- Ensure all tests pass:
make test - Ensure linter passes:
make lint - Update relevant documentation
- Sign off all commits (DCO)
- Open a PR against
main - Fill in the PR template
- Wait for review from a maintainer
Running Tests
# Unit tests
make test
# End-to-end tests (requires a running cluster)
make test-e2e
# Coverage report
make test COVERPROFILE=coverage.out
go tool cover -html=coverage.out
Reporting Issues
- Bugs: Use the bug report template
- Features: Use the feature request template
Code of Conduct
This project follows the CNCF Code of Conduct.