telstra / open-kilda

OpenKilda is an open-source OpenFlow controller initially designed for use in a global network with high control-plane latency and a heavy emphasis on latency-centric data path optimisation.
Apache License 2.0
77 stars 53 forks source link

GUI fix for gui switch-datatable and switch-detail components #5657

Open IvanChupin opened 1 month ago

IvanChupin commented 1 month ago

This fix change the logic of showing the orange triangle that shows the discrepancies for switch name that was received from controller(Northbound API) and from inventory service.

With the new logic, we do not have the triangle. Now on the switch-detail page we have two parts that represents the switch details data from northbound and switch details data from inventory service(switch-store).

Before the fix:

image

After the fix: Example of switch-detail page where switch exist only in Controller.

image

Example of switch-detail page where switch exist only in Inventory.

image

Example of switch-detail page where switch exist in controller and in inventory, but with some discrepancies:

image

Example of switch-detail page, where switch(with switch_id=A) exist in controller and multiple switches with the same switch_id exist in inventory service(not usual behaviour, but possible)

image

Also it should not show any discrepancy tab in case if we do not have inventory-service connected(setup) to Kilda-gui.

Discrepancy tab shows only the information about discrepancy in switch-state, as it was in an old logic.

In order to test this, you need to use rigel. I verified it on my local vm slightly tweaking the needed part of code. But for Rigel we do not need this tweak.

Possible test cases: Switch A exists only in Controller. Switch A exists only in Inventory service. Switch A exists both in Controller and Inventory service. Switch A exists both in Controller and Inventory service with different state.

closes https://github.com/telstra/open-kilda/issues/5661

yuliiamir commented 1 day ago

The following changes have been verified:

  1. A switch details page when the switch exists on both Controller and Inventory sides => BothCONTROLLER DETAILS and INVENTORY DETAILSsections are displayed + optional: Discrepancy tab(states mismatch).
  2. A switch details page when the switch exists ONLY on the Controller side => Only the “CONTROLLER DETAILS” section is displayed + Discrepancy tab “*Note: Switch doesn’t exist in the inventory”.
  3. A switch details page when the switch exists ONLY on the Inventory side => Only the “INVENTORY DETAILS”section is displayed + Discrepancy tab“*Note: Switch doesn’t exist in the controller”.
  4. Switches with the same ID in upper/lower case Inventory/Controller are treated as the same object.
  5. Switches with the same ID on the Inventory side are treated as different entities => There is a discrepancy on the Switch details page: Switch ID field: ‘There is another switch with the same switch ID in the inventory service.’
  6. In the case of opening the NON-EXISTING switch details page, the redirection to the ‘Switches’page is executed.
  7. Pop can be updated on the Controller side.
yuliiamir commented 1 day ago

The following changes have been verified:

  1. A switch details page when the switch exists on both Controller and Inventory sides => BothCONTROLLER DETAILS and INVENTORY DETAILSsections are displayed + optional: Discrepancy tab(states mismatch).
  2. A switch details page when the switch exists ONLY on the Controller side => Only the “CONTROLLER DETAILS” section is displayed + Discrepancy tab “*Note: Switch doesn’t exist in the inventory”.
  3. A switch details page when the switch exists ONLY on the Inventory side => Only the “INVENTORY DETAILS”section is displayed + Discrepancy tab“*Note: Switch doesn’t exist in the controller”.
  4. Switches with the same ID in upper/lower case Inventory/Controller are treated as the same object.
  5. Switches with the same ID on the Inventory side are treated as different entities => There is a discrepancy on the Switch details page: Switch ID field: ‘There is another switch with the same switch ID in the inventory service.’
  6. In the case of opening the NON-EXISTING switch details page, the redirection to the ‘Switches’page is executed.
  7. Pop can be updated on the Controller side.