diff --git a/packages/api-v4/.changeset/pr-13472-changed-1773131929522.md b/packages/api-v4/.changeset/pr-13472-changed-1773131929522.md
new file mode 100644
index 00000000000..a63287e6a07
--- /dev/null
+++ b/packages/api-v4/.changeset/pr-13472-changed-1773131929522.md
@@ -0,0 +1,5 @@
+---
+"@linode/api-v4": Changed
+---
+
+Update node balancer type for enterprise from premium_40GB to premium_40gb ([#13472](https://github.com/linode/manager/pull/13472))
diff --git a/packages/api-v4/src/nodebalancers/types.ts b/packages/api-v4/src/nodebalancers/types.ts
index 4ee00d3070c..75a1ee7babf 100644
--- a/packages/api-v4/src/nodebalancers/types.ts
+++ b/packages/api-v4/src/nodebalancers/types.ts
@@ -10,7 +10,7 @@ type UDPStickiness = 'none' | 'session' | 'source_ip';
export type Stickiness = TCPStickiness | UDPStickiness;
-type NodeBalancerType = 'common' | 'premium' | 'premium_40GB';
+type NodeBalancerType = 'common' | 'premium' | 'premium_40gb';
export interface LKEClusterInfo {
id: number;
diff --git a/packages/manager/.changeset/pr-13472-fixed-1773071273109.md b/packages/manager/.changeset/pr-13472-fixed-1773071273109.md
new file mode 100644
index 00000000000..fc996cab12f
--- /dev/null
+++ b/packages/manager/.changeset/pr-13472-fixed-1773071273109.md
@@ -0,0 +1,5 @@
+---
+"@linode/manager": Fixed
+---
+
+Update node balancer type for enterprise and remove duplicate nodebalancer rows in VPC subnet table ([#13472](https://github.com/linode/manager/pull/13472))
diff --git a/packages/manager/src/features/NodeBalancers/NodeBalancerDetail/NodeBalancerSummary/SummaryPanel.test.tsx b/packages/manager/src/features/NodeBalancers/NodeBalancerDetail/NodeBalancerSummary/SummaryPanel.test.tsx
index 6ea7fc427be..e0500ff86b2 100644
--- a/packages/manager/src/features/NodeBalancers/NodeBalancerDetail/NodeBalancerSummary/SummaryPanel.test.tsx
+++ b/packages/manager/src/features/NodeBalancers/NodeBalancerDetail/NodeBalancerSummary/SummaryPanel.test.tsx
@@ -162,9 +162,9 @@ describe('SummaryPanel', () => {
expect(typeElement).toBeVisible();
});
- it('displays type: Enterprise if the nodebalancer is premium_40GB', () => {
+ it('displays type: Enterprise if the nodebalancer is premium_40gb', () => {
queryMocks.useNodeBalancerQuery.mockReturnValue({
- data: nodeBalancerFactory.build({ type: 'premium_40GB' }),
+ data: nodeBalancerFactory.build({ type: 'premium_40gb' }),
});
const { getByText } = renderWithTheme();
diff --git a/packages/manager/src/features/NodeBalancers/NodeBalancerDetail/NodeBalancerSummary/SummaryPanel.tsx b/packages/manager/src/features/NodeBalancers/NodeBalancerDetail/NodeBalancerSummary/SummaryPanel.tsx
index 2ef256ac4c2..46b759d43b5 100644
--- a/packages/manager/src/features/NodeBalancers/NodeBalancerDetail/NodeBalancerSummary/SummaryPanel.tsx
+++ b/packages/manager/src/features/NodeBalancers/NodeBalancerDetail/NodeBalancerSummary/SummaryPanel.tsx
@@ -112,7 +112,7 @@ export const SummaryPanel = () => {
Type:
{nodebalancer.type === 'common' && 'Basic'}
{nodebalancer.type === 'premium' && 'Premium'}
- {nodebalancer.type === 'premium_40GB' && 'Enterprise'}
+ {nodebalancer.type === 'premium_40gb' && 'Enterprise'}
diff --git a/packages/manager/src/features/VPCs/VPCDetail/VPCSubnetsTable.tsx b/packages/manager/src/features/VPCs/VPCDetail/VPCSubnetsTable.tsx
index fe49e01abee..37fea394caa 100644
--- a/packages/manager/src/features/VPCs/VPCDetail/VPCSubnetsTable.tsx
+++ b/packages/manager/src/features/VPCs/VPCDetail/VPCSubnetsTable.tsx
@@ -315,6 +315,13 @@ export const VPCSubnetsTable = (props: Props) => {
const getTableItems = (): TableItem[] => {
return subnets.data.map((subnet) => {
+ // NodeBalancers can have same VPC subnet as its frontend and backend configuration.
+ // and this can create duplicate entries in the resources count and also in the list of nodebalancers assigned to a subnet.
+ // To avoid this, we are creating a unique list of nodebalancers based on their id.
+ const uniqueNodebalancers = Array.from(
+ new Map(subnet.nodebalancers.map((nb) => [nb.id, nb])).values()
+ );
+
const OuterTableCells = (
<>
@@ -326,7 +333,7 @@ export const VPCSubnetsTable = (props: Props) => {
)}
- {`${isNodebalancerVPCEnabled ? subnet.linodes.length + subnet.nodebalancers.length : subnet.linodes.length}`}
+ {`${isNodebalancerVPCEnabled ? subnet.linodes.length + uniqueNodebalancers.length : subnet.linodes.length}`}
@@ -336,7 +343,7 @@ export const VPCSubnetsTable = (props: Props) => {
handleEdit={handleSubnetEdit}
handleUnassignLinodes={handleSubnetUnassignLinodes}
numLinodes={subnet.linodes.length}
- numNodebalancers={subnet.nodebalancers.length}
+ numNodebalancers={uniqueNodebalancers.length}
subnet={subnet}
vpcId={vpcId}
/>
@@ -376,7 +383,7 @@ export const VPCSubnetsTable = (props: Props) => {
)}
- {isNodebalancerVPCEnabled && subnet.nodebalancers?.length > 0 && (
+ {isNodebalancerVPCEnabled && uniqueNodebalancers.length > 0 && (
{
{SubnetNodebalancerTableRowHead}
- {subnet.nodebalancers.map((nb) => (
+ {uniqueNodebalancers.map((nb) => (
({
}),
type: Factory.each((i) => {
if (i === 1) {
- return 'premium_40GB';
+ return 'premium_40gb';
}
if (i % 2 === 0) {
return 'premium';