feat: Add Infrahub Jinja2 transform for VRF/L3VNI configuration (#21)
- Add GraphQL query vrf_intent.gql: queries InfraVRFDeviceAssignment by device name, returning device-specific RD, VRF attributes (name, description, l3vni), and both device-level and VRF-level import/export route targets for fallback logic - Add Jinja2 template vrf_yang.j2: renders a JSON array of VRF config objects with RD fallback (device → VRF-level) and RT merge logic (device-level if present, otherwise VRF-level); all optional relationships guarded with 'is defined and is not none' checks - Update .infrahub.yml: register vrf_intent query and vrf_yang_transform - Add unit test fixtures for leaf3: input.json (mock GraphQL response) and output.json (expected rendered JSON array) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
15
infrahub/transforms/tests/vrf_yang/test.yml
Normal file
15
infrahub/transforms/tests/vrf_yang/test.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
version: "1.0"
|
||||
infrahub_tests:
|
||||
- resource: Jinja2Transform
|
||||
resource_name: vrf_yang_transform
|
||||
tests:
|
||||
- name: smoke_check
|
||||
spec:
|
||||
kind: jinja2-transform-smoke
|
||||
- name: render_leaf3
|
||||
spec:
|
||||
kind: jinja2-transform-unit-render
|
||||
directory: infrahub/transforms/tests/vrf_yang
|
||||
input: input.json
|
||||
output: output.json
|
||||
Reference in New Issue
Block a user