Skip to content

Fix network mapping not following source NIC changes - #942

Open
mihaelabalutoiu wants to merge 2 commits into
cloudbase:mainfrom
mihaelabalutoiu:fix-network-mapping-source-nic-changes
Open

mihaelabalutoiu wants to merge 2 commits into
cloudbase:mainfrom
mihaelabalutoiu:fix-network-mapping-source-nic-changes

Conversation

@mihaelabalutoiu

Copy link
Copy Markdown
Member

Previously, the Edit Transfer modal showed the NICs recorded by the last execution, so a NIC moved to another network on the source stayed invisible until the transfer ran again — and mapping it then left the obsolete entry behind in network_map.

This PR implements the following:

  • Reload instance details from the source — Reload All Options now queries the origin endpoint instead of re-deriving the NICs from the VM info stored on the transfer.
  • Replace the mapping of a changed source NIC — an update sends only the mappings of the NICs currently attached to the instances, so a new source network replaces the obsolete entry instead of being added next to it.
  • New test cases for TransferItemModal

`Reload All Options` re-derived them from the VM info stored on the
transfer, which only an execution refreshes, so it never queried the
origin endpoint. Also fixes the instance details fallback,
unreachable because an empty `dbInstancesDetails` array is truthy.

Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
`getSelectedNetworks()` rebuilt a mapping for every key of the
transfer's `network_map`, so mapping a NIC's new source network added
to the map instead of replacing the obsolete entry. Only the mappings
of the NICs currently attached to the instances are sent now, unless
there are no instance details.

Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>

@fabi200123 fabi200123 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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

Successfully merging this pull request may close these issues.

2 participants