Thank you for considering contributing to the Paperclip Kubernetes Operator!
Before creating bug reports, please check the existing issues to avoid duplicates.
Great bug reports include:
- A quick summary and/or background
- Steps to reproduce (be specific!)
- What you expected would happen
- What actually happens
- Kubernetes version, operator version, and other relevant environment details
- Fork the repo and create your branch from
main - If you've added code that should be tested, add tests
- If you've changed APIs, update the documentation
- Ensure the test suite passes
- Make sure your code lints
- Issue that pull request!
- Go 1.25+
- Docker
- kubectl
- Kind (for local testing)
- Make
# Clone your fork
git clone https://github.com/YOUR_USERNAME/k8s-operator.git
cd k8s-operator
# Install dependencies
go mod download
# Generate code and manifests
make generate manifests
# Run tests
make test
# Run linter
make lint# Create a Kind cluster
kind create cluster
# Install CRDs
make install
# Run the operator locally (outside the cluster)
make run# Run unit tests (fast, no envtest)
go test ./internal/resources/ -v
# Run all tests (unit + integration)
make test
# Run linter
make lint
# Run E2E tests (requires Kind)
make test-e2e
# Run benchmarks
make benchUse Conventional Commits:
feat:for new featuresfix:for bug fixesdocs:for documentation changeschore:for maintenance taskstest:for test additions/changesrefactor:for code refactoringci:for CI/CD changes
- Follow Effective Go guidelines
- Run
make fmtandmake lintbefore committing - Use
0o644(not0644) for octal literals - Wrap errors:
fmt.Errorf("context: %w", err) - Use the generic
Ptr[T]helper for pointer values
After modifying types in api/v1alpha1/instance_types.go:
- Run
make generate(regenerates deepcopy methods) - Run
make manifests(regenerates CRD YAML) - Run
make sync-chart-crds(syncs CRDs into Helm chart) - Commit the generated files
- Follow Kubernetes API conventions
- Always use
controllerutil.CreateOrUpdatefor managed resources (never barer.Update()) - Set
controllerutil.SetControllerReferenceon all managed resources
.
├── api/v1alpha1/ # CRD type definitions
├── cmd/ # Main entrypoint
├── config/ # Kubernetes manifests
│ ├── crd/ # CRD definitions
│ ├── manager/ # Operator deployment
│ ├── rbac/ # RBAC configuration
│ └── samples/ # Example CRs
├── internal/
│ ├── controller/ # Reconciliation logic
│ └── resources/ # Resource builders
├── charts/ # Helm chart
├── bundle/ # OLM bundle
└── test/e2e/ # E2E tests
- All submissions require review from a maintainer
- CI must pass before merging
- At least one approval is required
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.