Skip to content

Commit c2a9115

Browse files
change: [UIE-9861] - Handle Incompatibility of linode interfaces in create LKE flow (linode#13272)
1 parent d549891 commit c2a9115

File tree

5 files changed

+51
-2
lines changed

5 files changed

+51
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Changed
3+
---
4+
5+
Handle Incompatibility of linode interfaces in create LKE flow ([#13272](https://github.com/linode/manager/pull/13272))

packages/manager/src/features/Account/NetworkInterfaceType.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ export const NetworkInterfaceType = () => {
7575

7676
return (
7777
<Paper data-testid="network-interface-type">
78-
<Typography variant="h2">Network Interface Type</Typography>
78+
<Typography id="interface-type" variant="h2">
79+
Network Interface Type
80+
</Typography>
7981
<form onSubmit={handleSubmit(onSubmit)}>
8082
<Stack mt={1}>
8183
<Typography variant="body1">

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
useAccountSettings,
23
useAllTypes,
34
useMutateAccountAgreements,
45
useRegionsQuery,
@@ -12,6 +13,7 @@ import {
1213
Select,
1314
Stack,
1415
TextField,
16+
Typography,
1517
} from '@linode/ui';
1618
import { plansNoticesUtils, scrollErrorIntoViewV2 } from '@linode/utilities';
1719
import { createKubeClusterWithRequiredACLSchema } from '@linode/validation';
@@ -31,6 +33,7 @@ import { DocsLink } from 'src/components/DocsLink/DocsLink';
3133
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
3234
import { ErrorMessage } from 'src/components/ErrorMessage';
3335
import { LandingHeader } from 'src/components/LandingHeader';
36+
import { Link } from 'src/components/Link';
3437
import { RegionSelect } from 'src/components/RegionSelect/RegionSelect';
3538
import { RegionHelperText } from 'src/components/SelectRegionPanel/RegionHelperText';
3639
import { getRestrictedResourceText } from 'src/features/Account/utils';
@@ -123,6 +126,7 @@ export const CreateCluster = () => {
123126

124127
const { data, error: regionsError } = useRegionsQuery();
125128
const regionsData = data ?? [];
129+
const { data: accountSettings } = useAccountSettings();
126130
const { showAPL } = useAPLAvailability();
127131
const [ipV4Addr, setIPv4Addr] = React.useState<ExtendedIP[]>([
128132
stringToExtendedIP(''),
@@ -238,6 +242,9 @@ export const CreateCluster = () => {
238242
globalGrantType: 'add_lkes',
239243
});
240244

245+
const isInterfaceIncompatible =
246+
accountSettings?.interfaces_for_new_linodes === 'linode_only';
247+
241248
const {
242249
data: allTypes,
243250
error: typesError,
@@ -488,6 +495,21 @@ export const CreateCluster = () => {
488495
variant="error"
489496
/>
490497
)}
498+
{isInterfaceIncompatible && (
499+
<Notice sx={{ marginBottom: 2 }} variant="warning">
500+
<Typography>
501+
Your account’s{' '}
502+
<strong>
503+
Network Interface Type setting is incompatible with LKE
504+
</strong>
505+
. To create a cluster, update this setting to allow the option
506+
for Configuration Profile Interfaces.{' '}
507+
<Link to={'/account-settings#interface-type'}>
508+
Account settings
509+
</Link>
510+
</Typography>
511+
</Notice>
512+
)}
491513
<Paper data-qa-label-header>
492514
<TextField
493515
data-qa-label-input
@@ -700,6 +722,7 @@ export const CreateCluster = () => {
700722
? UNKNOWN_PRICE
701723
: highAvailabilityPrice
702724
}
725+
isInterfaceIncompatible={isInterfaceIncompatible}
703726
pools={nodePools}
704727
region={selectedRegion?.id}
705728
regionsData={regionsData}

packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.test.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,22 @@ describe('KubeCheckoutBar', () => {
5555
);
5656
});
5757

58+
it('should disable create button if Network Interface Type setting is linode only', async () => {
59+
const { getByText } = renderWithThemeAndHookFormContext({
60+
component: <KubeCheckoutBar {...props} isInterfaceIncompatible={true} />,
61+
useFormOptions: {
62+
defaultValues: {
63+
nodePools: [nodePoolFactory.build()],
64+
},
65+
},
66+
});
67+
68+
expect(getByText('Create Cluster').closest('button')).toHaveAttribute(
69+
'aria-disabled',
70+
'true'
71+
);
72+
});
73+
5874
it('should render a section for each pool', async () => {
5975
const { queryAllByTestId } = renderWithThemeAndHookFormContext({
6076
component: <KubeCheckoutBar {...props} />,

packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export interface Props {
4343
hasAgreed: boolean;
4444
highAvailability?: boolean;
4545
highAvailabilityPrice: string;
46+
isInterfaceIncompatible?: boolean;
4647
pools: CreateNodePoolData[];
4748
region: string | undefined;
4849
regionsData: Region[];
@@ -58,6 +59,7 @@ export const KubeCheckoutBar = (props: Props) => {
5859
hasAgreed,
5960
highAvailability,
6061
highAvailabilityPrice,
62+
isInterfaceIncompatible,
6163
pools,
6264
region,
6365
regionsData,
@@ -98,7 +100,8 @@ export const KubeCheckoutBar = (props: Props) => {
98100
needsAPool ||
99101
gdprConditions ||
100102
(haConditions && !enterprisePrice) ||
101-
!region
103+
!region ||
104+
isInterfaceIncompatible
102105
);
103106

104107
if (isLoading) {

0 commit comments

Comments
 (0)