Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create function for comparing FFE node labels #143

Open
chrismarget-j opened this issue Jun 13, 2023 · 0 comments
Open

Create function for comparing FFE node labels #143

chrismarget-j opened this issue Jun 13, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@chrismarget-j
Copy link
Collaborator

The FFE feature in apstra versions node labels by appending / incrementing a node label suffix of the form _vNN where _v are literal characters 0x5F and 0x76. and NN is a variable length string of digits (0x30 - 0x39).

The suffix is guaranteed to be at least 3 characters long (first FFE suffix will be _v2 -- _v0 and _v1 will never appear as an FFE-generated suffix) and has no defined upper length bound.

The entire label will never be more than 64 characters.

Each time a new label is required the label is trimmed so that label+suffix doesn't exceed 64 characters.

The code responsible is the _gen_label function in aos/reference_design/fabric_expansion_util.py.

Our terraform provider has a check which attempts to discern whether a given label is the suffixed-version of an un-suffixed label:

Is foo_v2 a revision of foo?

It's at the end of Read() in apstra/resource_datacenter_device_allocation.go:
https://github.com/Juniper/terraform-provider-apstra/blob/69d2449cbaf51b54377a581b06fa938f5e94c603/apstra/resource_datacenter_device_allocation.go#LL173C1-L185C1

This check will fail with labels which have been trimmed to apply the suffix.

We need a function which compares labels with the trim mechanism in mind.

That function should be tested with un-suffixed labels which end _v2.

@bwJuniper bwJuniper added the enhancement New feature or request label Aug 30, 2023
@bwJuniper bwJuniper changed the title task: function for comparing FFE node labels Create function for comparing FFE node labels Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants