Skip to content

fix(qinq): declare IpamSVLAN name unique so the CVLAN HFID validates - #96

Open
minitriga wants to merge 1 commit into
mainfrom
atg-qinq-svlan-name-unique
Open

minitriga wants to merge 1 commit into
mainfrom
atg-qinq-svlan-name-unique

Conversation

@minitriga

Copy link
Copy Markdown
Contributor

Problem

Loading the QinQ extension fails on older Infrahub servers:

HFID of IpamCVLAN refers to peer IpamSVLAN with a non-unique combination of attributes ['name__value']

Reported via the marketplace: infrahubctl marketplace get infrahub/traditional-infrastructure-sot --collection followed by infrahubctl schema load.

Cause

IpamCVLAN.human_friendly_id is [svlan__name__value, vlan_id__value]. With schema_strict_mode on (the default), Infrahub requires name to be unique on IpamSVLAN. IpamSVLAN doesn't declare that: its only explicit constraint is [vlan_id__value, vlan_group], and it gets name__value as its HFID from IpamGenericVLAN.

  • Infrahub 1.9 and later re-run HFID processing after inheritance, so the inherited HFID is added to IpamSVLAN's uniqueness constraints and validation passes.
  • Infrahub 1.8 and earlier don't, so the check fails.

Fix

Declare [name__value] explicitly on IpamSVLAN. On 1.9+ this is the constraint Infrahub already derives, so the effective schema doesn't change. It just stops depending on the server version. The docs are regenerated and a fixed news fragment is added.

Testing

  • yamllint -s . passes.
  • Not loaded into a pre-1.9 Infrahub. The cause comes from reading SchemaBranch.process_pre_validation / validate_human_friendly_id at infrahub-v1.8.0 vs infrahub-v1.9.0. The CI load-all-schemas job covers current Infrahub.

🤖 Generated with Claude Code

IpamCVLAN builds its HFID from svlan__name__value, and strict schema
mode requires that attribute to be unique on the peer. IpamSVLAN only
got a name__value constraint implicitly, from the HFID it inherits off
IpamGenericVLAN, and releases before Infrahub 1.9 don't propagate an
inherited HFID into uniqueness constraints, so they rejected the
extension. Declaring the constraint makes it load everywhere; on 1.9+
the effective schema is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Deploying schema-library with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0420e96
Status: ✅  Deploy successful!
Preview URL: https://924235f3.schema-library.pages.dev
Branch Preview URL: https://atg-qinq-svlan-name-unique.schema-library.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants