portTemplate.start is arithmetic, so a non-numeric start invents ports #1525
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1525
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
engine/topology.js:28treatsportTemplate.startas a number to add to, not a literal first name.start: '1/0/1'silently producedGi1/0/10..Gi1/0/13in a probe.No spec in the catalogue currently uses a non-numeric
start, which is why nothing catches it.test/template-expansion.test.js:97shows the supported form: the chassis belongs inprefix-{prefix: 'Gi1/0/', start: 1, count: 24}.Why it matters: the importer will generate templates from observed device names. A generated template with a slashed start would create ports with plausible-looking but wrong names, and every downstream fact would then be attached to the wrong port.
Suggested fix: refuse a non-numeric
startby name, with the message naming theprefix/startsplit as the correct form.startis a name is refused, not added to (#1525) #1558