Follow these steps to add new resources or update existing fields:
- Go Definitions: Update
device/${VERSION}/${TYPE}_types.go. Ensure you include the necessary marker comments (e.g.,// +k8s:deepcopy-gen) required by the generators. - Proto Definitions: Update
proto/device/${VERSION}/${TYPE}.proto. Ensure Protobuf field numbers are never reused or changed once released. - Registration: If adding a new Kind, register it in
device/${VERSION}/register.gowithin theaddKnownTypesfunction. - Conversion Logic: Update the mapping interface in
device/${VERSION}/converter.go. See Goverter documentation for additional details. - Generate: Run
make code-gen. This orchestratesprotoc,deepcopy-gen, andgoverterto refresh all artifacts.
- Kubernetes Resource Model (KRM):
- Go type definitions must strictly follow the standard Kubernetes Resource Model.
- Separation of Concerns: Use
Specfor desired configuration andStatusfor observed state.
If your generated files are out of sync or contain stale data:
# Removes generated code (bindings, deepcopy, goverter)
make clean