Thank you for your interest in contributing to the virt-platform-autopilot project!
The virt-platform-autopilot is a template-driven platform operator that manages OpenShift Virtualization infrastructure automatically. Most contributions involve adding new managed resources (assets) or improving existing ones.
The most common contribution is adding new assets to extend the platform's capabilities. See the Adding Assets Guide for step-by-step instructions on:
- Creating template files
- Adding entries to the metadata catalog
- Testing your assets
- Handling soft dependencies
- Generating RBAC permissions
- Fork the repository and create a feature branch
- Make your changes following the patterns in the codebase
- Test your changes:
make test # Run unit tests make test-integration # Run integration tests make kind-setup # Setup local cluster make deploy-local # Deploy and test locally
- Format your code:
make fmt - Submit a pull request with a clear description of your changes
For setting up a local development environment with Kind (Kubernetes in Docker), see the Local Development Guide.
Quick start:
make kind-setup # Setup local cluster with CRDs
make deploy-local # Deploy autopilot
make logs-local # View logs
make redeploy-local # Redeploy after changes- Follow standard Go formatting (
gofmt,goimports) - Add unit tests for new functionality
- Keep functions focused and well-named
- Document exported functions and types
- Use
.yaml.tplextension for Go templates - Use
.yamlfor static resources - Handle missing CRDs gracefully with
crdExistschecks - Make templates idempotent (same input = same output)
- Add comments for complex template logic
- Update relevant documentation when adding features
- Keep examples current and working
- Use clear, concise language
- Include code examples where helpful
virt-platform-autopilot/
├── cmd/ # Entrypoints and CLI tools
├── pkg/ # Core implementation
│ ├── controller/ # Main reconciler
│ ├── engine/ # Rendering and patching
│ ├── assets/ # Asset loading
│ └── overrides/ # User customization logic
├── assets/ # Embedded templates
│ ├── active/ # Applied to cluster
│ └── tombstones/ # Marked for deletion
├── config/ # Kubernetes manifests
└── docs/ # Documentation
All contributions should include appropriate tests:
make testTest individual functions and logic. Located in *_test.go files alongside source code.
make test-integrationTest full controller behavior using envtest (simulated API server).
make kind-setup
make deploy-local
kubectl get pods -n openshift-cnvTest with real Kubernetes cluster (Kind).
- Ensure all tests pass before submitting
- Update documentation if adding features or changing behavior
- Keep PRs focused - one feature or fix per PR
- Write clear commit messages describing what and why
- Respond to review feedback promptly
We require every contributor to certify that they are legally permitted to contribute to this project. A contributor expresses this by signing their commits, thereby stating compliance with the Developer Certificate of Origin.
A signed commit includes a line like the following in the commit message:
Signed-off-by: Jane Doe <jane.doe@example.com>
Add --signoff to your git commit command, or use git commit -s. See
Commit Messages below for message formatting.
Follow these guidelines:
- Use imperative mood ("Add feature" not "Added feature")
- Keep first line under 72 characters
- Include details in body if needed
- Reference issues: "Fixes #123"
Example:
Add GPU passthrough asset for NVIDIA devices
Implements automatic GPU passthrough configuration when NVIDIA
devices are detected. Uses soft dependencies to gracefully handle
clusters without GPU operator installed.
Fixes #42
- Documentation: Start with README.md and docs/
- Issues: Check existing issues or open a new one
- Architecture: See ARCHITECTURE.md for technical details
Be respectful, inclusive, and collaborative. We welcome contributors of all backgrounds and skill levels.
By contributing, you agree that your contributions will be licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
Ready to add your first asset? Start with the Adding Assets Guide!