macro_rules! generate_record_wrapper {
($wrapper_fn:ident, $record_type:ty, $reconcile_fn:path, $kind_const:path, $display_name:expr) => { ... };
}Expand description
Macro to generate record reconciliation wrapper functions.
This eliminates ~900 lines of duplicate code by generating identical wrappers for all 8 DNS record types with only the type and constant names changing.
§Generated Function Pattern
For each record type, generates an async function that:
- Tracks reconciliation timing
- Calls the type-specific reconcile function
- Records metrics (success/error)
- Checks resource readiness status
- Returns appropriate requeue action
§Example
ⓘ
generate_record_wrapper!(
reconcile_arecord_wrapper, // Function name
ARecord, // Record type
reconcile_a_record, // Reconcile function
KIND_A_RECORD, // Metrics constant
"ARecord" // Display name
);