Skip to content

Commit

Permalink
feat(dataplanes): integrates Gateways in Data Plane Proxy list view
Browse files Browse the repository at this point in the history
Integrates the Gateway list view in the Data Plane Proxy list view. Adds a type column and the appropriate type filter to the DPP list view and the service detail view’s DPP list.

Removes the protocol and zone columns.

Signed-off-by: Philipp Rudloff <[email protected]>
  • Loading branch information
Philipp Rudloff committed Nov 9, 2023
1 parent a655564 commit 95f08c5
Show file tree
Hide file tree
Showing 28 changed files with 495 additions and 981 deletions.
10 changes: 0 additions & 10 deletions features/application/ListViewNavigation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ Feature: application / ListViewNavigation
| /zones/bandwidth-0/egresses | [data-testid='zone-egress-detail-view'] |
| /zones/bandwidth-0/ingresses | [data-testid='zone-ingress-detail-view'] |
| /meshes | [data-testid='mesh-detail-view'] |
# TODO: Fix this view having the wrong route data-testid. It’s caused by us re-using the DPP-specific view components in gateway routes.
# | /meshes/default/gateways | [data-testid='gateway-detail-view'] |
| /meshes/default/data-planes | [data-testid='data-plane-detail-view'] |
| /meshes/default/services | [data-testid='service-detail-view'] |
| /meshes/default/policies | [data-testid='policy-detail-view'] |

# TODO: Remove this scenario once it can be handled by the previous one.
Scenario: The /meshes/default/gateways list view has correct detail view link
When I visit the "/meshes/default/gateways" URL
And I click the "$detail-link" element

Then the URL contains "/meshes/default/gateways"
And the URL contains "/overview"
3 changes: 0 additions & 3 deletions features/application/Titles.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ Feature: application / titles
| /meshes/default/services | Services |
| /meshes/default/services/service-name/overview | service-name |

| /meshes/default/gateways | Gateways |
| /meshes/default/gateways/gateway-name/overview | gateway-name |

| /meshes/default/data-planes | Data Plane Proxies |
| /meshes/default/data-planes/data-plane-name/overview | data-plane-name |

Expand Down
61 changes: 61 additions & 0 deletions features/mesh/dataplanes/DataplanePolicies.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Feature: Dataplane policies
Background:
Given the CSS selectors
| Alias | Selector |
| builtin-gateway-dataplane-policies | [data-testid='builtin-gateway-dataplane-policies'] |
| standard-dataplane-policies | [data-testid='standard-dataplane-policies'] |

Scenario: Dataplane policies view shows expected content for standard proxy
Given the URL "/meshes/default/dataplanes/dataplane-1/_overview" responds with
"""
body:
mesh: default
dataplane:
networking:
gateway: !!js/undefined
"""
When I visit the "/meshes/default/data-planes/dataplane-1/policies" URL

Then the "$standard-dataplane-policies" element exists

Scenario: Dataplane policies view shows expected content for delegated gateway
Given the URL "/meshes/default/dataplanes/dataplane-1/_overview" responds with
"""
body:
mesh: default
dataplane:
networking:
gateway:
type: DELEGATED
"""
When I visit the "/meshes/default/data-planes/dataplane-1/policies" URL

Then the "$standard-dataplane-policies" element exists

Scenario: Dataplane policies view shows expected content for delegated gateway (with omitted type field)
Given the URL "/meshes/default/dataplanes/dataplane-1/_overview" responds with
"""
body:
mesh: default
dataplane:
networking:
gateway:
type: !!js/undefined
"""
When I visit the "/meshes/default/data-planes/dataplane-1/policies" URL

Then the "$standard-dataplane-policies" element exists

Scenario: Dataplane policies view shows expected content for built-in gateway
Given the URL "/meshes/default/dataplanes/dataplane-1/_overview" responds with
"""
body:
mesh: default
dataplane:
networking:
gateway:
type: BUILTIN
"""
When I visit the "/meshes/default/data-planes/dataplane-1/policies" URL

Then the "$builtin-gateway-dataplane-policies" element exists
1 change: 1 addition & 0 deletions features/mesh/dataplanes/DetailViewContent.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Feature: Data Plane Proxies: Detail view content
And the environment
"""
KUMA_SUBSCRIPTION_COUNT: 2
KUMA_DATAPLANEINBOUND_COUNT: 1
KUMA_MODE: global
"""
And the URL "/meshes/default/dataplanes/dpp-1-name-of-dataplane/_overview" responds with
Expand Down
163 changes: 122 additions & 41 deletions features/mesh/dataplanes/Index.feature
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
Feature: mesh / dataplanes / index
Background:
Given the CSS selectors
| Alias | Selector |
| table | [data-testid='data-plane-collection'] |
| table-header | $table th |
| item | $table tbody tr |
| service-cell | $item:nth-child(1) td:nth-child(2) |
| protocol-cell | $item:nth-child(1) td:nth-child(3) |
| zone-cell | $item:nth-child(1) td:nth-child(4) |
| Alias | Selector |
| table | [data-testid='data-plane-collection'] |
| table-header | $table th |
| item | $table tbody tr |
| service-cell | $item:nth-child(1) td:nth-child(3) |
| select-type | [data-testid='k-select-input'] |
| select-option | .k-select-item |
| select-standard | [data-testid='k-select-item-standard'] |
| select-builtin | [data-testid='k-select-item-builtin'] |
| select-delegated | [data-testid='k-select-item-delegated'] |
And the environment
"""
KUMA_MODE: global
KUMA_DATAPLANE_COUNT: 9
KUMA_DATAPLANEINBOUND_COUNT: 1
KUMA_SUBSCRIPTION_COUNT: 2
"""
And the URL "/meshes/default/dataplanes/_overview" responds with
Expand All @@ -21,13 +26,12 @@ Feature: mesh / dataplanes / index
mesh: fake-default
dataplane:
networking:
gateway: !!js/undefined
inbound:
- health:
ready: true
tags:
kuma.io/service: service-1
kuma.io/protocol: http
kuma.io/zone: zone-1
dataplaneInsight:
mTLS:
certificateExpirationTime: 2023-11-03T09:10:17Z
Expand All @@ -39,39 +43,15 @@ Feature: mesh / dataplanes / index
- name: fake-frontend
"""

Scenario: The Proxy listing table has the correct columns (mode: global)
Given the environment
"""
KUMA_MODE: global
"""

When I visit the "/meshes/default/data-planes" URL

Then the "$table-header" element exists 8 times
And the "$table-header" elements contain
| Value |
| Name |
| Service |
| Protocol |
| Zone |
| Certificate Info |
| Status |
| Warnings |

Scenario: The Proxy listing table has the correct columns (mode: standalone)
Given the environment
"""
KUMA_MODE: standalone
"""

Scenario: The Proxy listing table has the correct columns
When I visit the "/meshes/default/data-planes" URL

Then the "$table-header" element exists 7 times
And the "$table-header" elements contain
| Value |
| Name |
| Type |
| Service |
| Protocol |
| Certificate Info |
| Status |
| Warnings |
Expand All @@ -83,9 +63,8 @@ Feature: mesh / dataplanes / index
Then the "$item:nth-child(1)" element contains
| Value |
| fake-backend |
| Standard proxy |
| service-1 |
| http |
| zone-1 |
| Nov 3, 2023, 9:10 AM |
| online |

Expand All @@ -103,13 +82,12 @@ Feature: mesh / dataplanes / index
mesh: fake-default
dataplane:
networking:
gateway: !!js/undefined
inbound:
- health:
ready: true
tags:
kuma.io/service: !!js/undefined
kuma.io/protocol: !!js/undefined
kuma.io/zone: !!js/undefined
dataplaneInsight:
mTLS:
certificateExpirationTime: !!js/undefined
Expand All @@ -120,11 +98,114 @@ Feature: mesh / dataplanes / index
When I visit the "/meshes/default/data-planes" URL

Then the "$service-cell" element is empty
Then the "$protocol-cell" element is empty
Then the "$zone-cell" element is empty

Then the "$item:nth-child(1)" element contains
| Value |
| dpp-2 |
| No certificate |
| offline |

Rule: The listing can be filtered by type
Scenario: Filtering by "builtin"
Given the environment
"""
KUMA_DATAPLANE_COUNT: 1
KUMA_DATAPLANEINBOUND_COUNT: 0
"""
And the URL "/meshes/default/dataplanes/_overview" responds with
"""
body:
items:
- name: fake-transmitter-gateway_builtin-0
dataplane:
networking:
gateway:
type: 'BUILTIN'
tags:
kuma.io/service: service-1
"""

When I visit the "/meshes/default/data-planes" URL
And I click the "$select-type" element

Then the "$select-option" element exists 4 times

When I click the "$select-builtin" element
Then the URL "/meshes/default/dataplanes/_overview" was requested with
"""
searchParams:
gateway: builtin
"""
And the "$item" element exists 1 time
And the "$item:nth-child(1)" element contains
| Value |
| fake-transmitter-gateway_builtin-0 |
| Built-in gateway |

Scenario: Filtering by "delegated"
Given the environment
"""
KUMA_DATAPLANE_COUNT: 1
KUMA_DATAPLANEINBOUND_COUNT: 0
"""
And the URL "/meshes/default/dataplanes/_overview" responds with
"""
body:
items:
- name: fake-alarm-gateway_delegated-0
dataplane:
networking:
gateway:
type: 'DELEGATED'
tags:
kuma.io/service: service-1
"""

When I visit the "/meshes/default/data-planes" URL
And I click the "$select-type" element

Then the "$select-option" element exists 4 times

When I click the "$select-delegated" element
Then the URL "/meshes/default/dataplanes/_overview" was requested with
"""
searchParams:
gateway: delegated
"""
And the "$item" element exists 1 time
And the "$item:nth-child(1)" element contains
| Value |
| fake-alarm-gateway_delegated-0 |
| Delegated gateway |

Scenario: Filtering by "standard"
Given the environment
"""
KUMA_DATAPLANE_COUNT: 1
"""
And the URL "/meshes/default/dataplanes/_overview" responds with
"""
body:
items:
- name: fake-system-proxy-0
dataplane:
networking:
gateway: !!js/undefined
"""

When I visit the "/meshes/default/data-planes" URL
And I click the "$select-type" element

Then the "$select-option" element exists 4 times

When I click the "$select-standard" element
Then the URL "/meshes/default/dataplanes/_overview" was requested with
"""
searchParams:
gateway: 'false'
"""
And the "$item" element exists 1 time
And the "$item:nth-child(1)" element contains
| Value |
| fake-system-proxy-0 |
| Standard proxy |
13 changes: 13 additions & 0 deletions features/mesh/dataplanes/NoSubscriptions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,20 @@ Feature: dataplanes / no-subscriptions
And the environment
"""
KUMA_SUBSCRIPTION_COUNT: 0
KUMA_DATAPLANEINBOUND_COUNT: 1
"""
And the URL "/meshes/default/dataplanes/dpp-1/_overview" responds with
"""
body:
name: fake-backend
mesh: fake-default
dataplane:
networking:
inbound:
- health:
ready: true
"""

When I visit the "/meshes/default/data-planes/dpp-1/overview" URL
And the "$detail-view" element contains "dpp-1"
And the "$overview-content" element contains "offline"
Loading

0 comments on commit 95f08c5

Please sign in to comment.