Handle routing destinations and static addresses in API like the CLI [specific ci=Group23-VIC-Machine-Service] #6743
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
vic-machine
CLI has differing requirements for gateway routing information, depending on the type of network.According to the CLI help:
This does not seem to be enforced in code, and may simply be more of a suggestion about how these gateways should be used than a requirement.
Update the parsing for client, public, and management to support all zero or more routing destinations in all cases; defer to the existing
ProcessNetwork
code to ensure consistent validation behavior now and in the future.Additionally update the parsing for container to provide a clear error message if the expected routing destination is not supplied.
Fixes #6715
The vic-machine CLI requires that static addresses are specified as a CIDR, which allows the static address and subnet mask to be supplied in a compact way on the command line. This pattern does not allow for static addresses to be expressed in terms of a hostname.
Update the API to match this convention. We may wish to allow for more flexibility in the API in the future, but there's value in at least starting with consistent behavior.