[dev] Deduplicate ingress/egress subnets and addresses for NetworkInfo results #11535
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.
Description of change
Due to the way that addresses are being collected and merged together by the machiner and instancepoller workers, we may end up with duplicate entries for the public IP addresses when running on aws substrates (for more information see this related bug).
As a result,
network-get
may potentially return duplicate entries as shown in https://bugs.launchpad.net/juju/+bug/1864072 which this PR masks by filtering the output of theNetworkInfo
API call at the facade level to remove duplicates before returning the result back to the client.This particular route (deduplication vs fixing the problem at the core) was chosen after considering the fact that there is active ongoing (longer-term) work with networking internals which will eventually fix the problem. The proposed solution ensures that consumers get the right result while still buying us additional time to land a better fix.
QA steps
Bug reference
https://bugs.launchpad.net/juju/+bug/1864072