Development Workflow¶
Daily development workflow for Bindy contributors.
Development Cycle¶
-
Create feature branch
-
Make changes
- Edit code in
src/ - If modifying CRDs, edit Rust types in
src/crd.rs - Add tests
-
Update documentation
-
Regenerate CRDs (if modified)
-
Test locally
-
Validate CRDs
-
Commit changes
-
Push and create PR
CRD Development¶
IMPORTANT: src/crd.rs is the source of truth. CRD YAML files in deploy/crds/ are auto-generated.
Modifying Existing CRDs¶
-
Edit the Rust type in
src/crd.rs:#[derive(CustomResource, Clone, Debug, Serialize, Deserialize, JsonSchema)] #[kube( group = "bindy.firestoned.io", version = "v1beta1", kind = "Bind9Cluster", namespaced )] #[serde(rename_all = "camelCase")] pub struct Bind9ClusterSpec { pub version: Option<String>, // Add new fields here pub new_field: Option<String>, } -
Regenerate YAML files:
-
Verify the generated YAML:
-
Update documentation to describe the new field
Adding New CRDs¶
- Define the CustomResource in
src/crd.rs - Add to crdgen in
src/bin/crdgen.rs: - Regenerate YAMLs:
make crds - Export the type in
src/lib.rsif needed
Generated YAML Format¶
All generated CRD files include: - Copyright header - SPDX license identifier - Auto-generated warning
Never edit YAML files directly - they will be overwritten!
Local Testing¶
# Start kind cluster
kind create cluster --name bindy-dev
# Deploy CRDs (regenerate first if modified)
make crds
kubectl apply -k deploy/crds/
# Run operator locally
RUST_LOG=debug cargo run