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

Fabric settings max_*_routes - need a "don't care" option #230

Open
chrismarget-j opened this issue Mar 4, 2024 · 0 comments
Open

Fabric settings max_*_routes - need a "don't care" option #230

chrismarget-j opened this issue Mar 4, 2024 · 0 comments

Comments

@chrismarget-j
Copy link
Collaborator

Each of the max_*_routes elements in the FabricSettings{} struct has 2 possible states:

  • nil pointer, in which case we send null to to clear the current value (the omitempty struct tag is not configured)
  • non-nil pointer, in which case we send a numeric value

There's no way for a caller to indicate whether they intend to clear the current value.

One possible option:

  • Change the type in the public and private structs from *uint32 to *int64
  • Give special meaning to -1 (affirm clearing the value)
  • Write a MarshalJson method which determines whether the values will be sent based on the -1

This approach is complicated by the need to support Apstra 4.2.1, 4.2.0 and 4.1.x, which each handle this data a bit differently.

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

No branches or pull requests

1 participant