Skip to content

Commit fb9c2d2

Browse files
upcoming: [M3-8245] – Update "Add Node Pools" description in LKE Create flow (#10578)
1 parent f1a02f9 commit fb9c2d2

3 files changed

Lines changed: 39 additions & 10 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Upcoming Features
3+
---
4+
5+
Update description for Add Node Pools section in LKE Create flow ([#10578](https://github.com/linode/manager/pull/10578))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const ADD_NODE_POOLS_DESCRIPTION =
2+
'Add groups of Linodes to your cluster. You can have a maximum of 250 Linodes per node pool. Node Pool data is encrypted at rest.';

packages/manager/src/features/Kubernetes/CreateCluster/NodePoolPanel.tsx

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
import { KubeNodePoolResponse, LinodeTypeClass, Region } from '@linode/api-v4';
21
import Grid from '@mui/material/Unstable_Grid2';
32
import * as React from 'react';
43

54
import { CircleProgress } from 'src/components/CircleProgress';
5+
import { useIsDiskEncryptionFeatureEnabled } from 'src/components/DiskEncryption/utils';
66
import { ErrorState } from 'src/components/ErrorState/ErrorState';
7-
import { ExtendedType, extendType } from 'src/utilities/extendType';
7+
import { useRegionsQuery } from 'src/queries/regions/regions';
8+
import { doesRegionSupportFeature } from 'src/utilities/doesRegionSupportFeature';
9+
import { extendType } from 'src/utilities/extendType';
810

11+
import { ADD_NODE_POOLS_DESCRIPTION } from '../ClusterList/constants';
912
import { KubernetesPlansPanel } from '../KubernetesPlansPanel/KubernetesPlansPanel';
1013

14+
import type {
15+
KubeNodePoolResponse,
16+
LinodeTypeClass,
17+
Region,
18+
} from '@linode/api-v4';
19+
import type { ExtendedType } from 'src/utilities/extendType';
20+
1121
const DEFAULT_PLAN_COUNT = 3;
1222

1323
export interface NodePoolPanelProps {
@@ -23,15 +33,11 @@ export interface NodePoolPanelProps {
2333
typesLoading: boolean;
2434
}
2535

26-
export const NodePoolPanel: React.FunctionComponent<NodePoolPanelProps> = (
27-
props
28-
) => {
36+
export const NodePoolPanel = (props: NodePoolPanelProps) => {
2937
return <RenderLoadingOrContent {...props} />;
3038
};
3139

32-
const RenderLoadingOrContent: React.FunctionComponent<NodePoolPanelProps> = (
33-
props
34-
) => {
40+
const RenderLoadingOrContent = (props: NodePoolPanelProps) => {
3541
const { typesError, typesLoading } = props;
3642

3743
if (typesError) {
@@ -45,7 +51,7 @@ const RenderLoadingOrContent: React.FunctionComponent<NodePoolPanelProps> = (
4551
return <Panel {...props} />;
4652
};
4753

48-
const Panel: React.FunctionComponent<NodePoolPanelProps> = (props) => {
54+
const Panel = (props: NodePoolPanelProps) => {
4955
const {
5056
addNodePool,
5157
apiError,
@@ -57,6 +63,12 @@ const Panel: React.FunctionComponent<NodePoolPanelProps> = (props) => {
5763
types,
5864
} = props;
5965

66+
const {
67+
isDiskEncryptionFeatureEnabled,
68+
} = useIsDiskEncryptionFeatureEnabled();
69+
70+
const regions = useRegionsQuery().data ?? [];
71+
6072
const [typeCountMap, setTypeCountMap] = React.useState<Map<string, number>>(
6173
new Map()
6274
);
@@ -81,17 +93,27 @@ const Panel: React.FunctionComponent<NodePoolPanelProps> = (props) => {
8193
setSelectedType(planId);
8294
};
8395

96+
const regionSupportsDiskEncryption = doesRegionSupportFeature(
97+
selectedRegionId ?? '',
98+
regions,
99+
'Disk Encryption'
100+
);
101+
84102
return (
85103
<Grid container direction="column">
86104
<Grid>
87105
<KubernetesPlansPanel
106+
copy={
107+
isDiskEncryptionFeatureEnabled && regionSupportsDiskEncryption
108+
? ADD_NODE_POOLS_DESCRIPTION
109+
: 'Add groups of Linodes to your cluster. You can have a maximum of 100 Linodes per node pool.'
110+
}
88111
getTypeCount={(planId) =>
89112
typeCountMap.get(planId) ?? DEFAULT_PLAN_COUNT
90113
}
91114
types={extendedTypes.filter(
92115
(t) => t.class !== 'nanode' && t.class !== 'gpu'
93116
)} // No Nanodes or GPUs in clusters
94-
copy="Add groups of Linodes to your cluster. You can have a maximum of 100 Linodes per node pool."
95117
error={apiError}
96118
hasSelectedRegion={hasSelectedRegion}
97119
header="Add Node Pools"

0 commit comments

Comments
 (0)