diff --git a/packages/manager/.changeset/pr-13272-changed-1768292265959.md b/packages/manager/.changeset/pr-13272-changed-1768292265959.md new file mode 100644 index 00000000000..790f22fe5cb --- /dev/null +++ b/packages/manager/.changeset/pr-13272-changed-1768292265959.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Changed +--- + +Handle Incompatibility of linode interfaces in create LKE flow ([#13272](https://github.com/linode/manager/pull/13272)) diff --git a/packages/manager/src/features/Account/NetworkInterfaceType.tsx b/packages/manager/src/features/Account/NetworkInterfaceType.tsx index 9e42490ddd0..0f4903de44d 100644 --- a/packages/manager/src/features/Account/NetworkInterfaceType.tsx +++ b/packages/manager/src/features/Account/NetworkInterfaceType.tsx @@ -75,7 +75,9 @@ export const NetworkInterfaceType = () => { return ( - Network Interface Type + + Network Interface Type +
diff --git a/packages/manager/src/features/Kubernetes/CreateCluster/CreateCluster.tsx b/packages/manager/src/features/Kubernetes/CreateCluster/CreateCluster.tsx index ea7063d3823..40f25f36e57 100644 --- a/packages/manager/src/features/Kubernetes/CreateCluster/CreateCluster.tsx +++ b/packages/manager/src/features/Kubernetes/CreateCluster/CreateCluster.tsx @@ -1,4 +1,5 @@ import { + useAccountSettings, useAllTypes, useMutateAccountAgreements, useRegionsQuery, @@ -12,6 +13,7 @@ import { Select, Stack, TextField, + Typography, } from '@linode/ui'; import { plansNoticesUtils, scrollErrorIntoViewV2 } from '@linode/utilities'; import { createKubeClusterWithRequiredACLSchema } from '@linode/validation'; @@ -31,6 +33,7 @@ import { DocsLink } from 'src/components/DocsLink/DocsLink'; import { DocumentTitleSegment } from 'src/components/DocumentTitle'; import { ErrorMessage } from 'src/components/ErrorMessage'; import { LandingHeader } from 'src/components/LandingHeader'; +import { Link } from 'src/components/Link'; import { RegionSelect } from 'src/components/RegionSelect/RegionSelect'; import { RegionHelperText } from 'src/components/SelectRegionPanel/RegionHelperText'; import { getRestrictedResourceText } from 'src/features/Account/utils'; @@ -123,6 +126,7 @@ export const CreateCluster = () => { const { data, error: regionsError } = useRegionsQuery(); const regionsData = data ?? []; + const { data: accountSettings } = useAccountSettings(); const { showAPL } = useAPLAvailability(); const [ipV4Addr, setIPv4Addr] = React.useState([ stringToExtendedIP(''), @@ -238,6 +242,9 @@ export const CreateCluster = () => { globalGrantType: 'add_lkes', }); + const isInterfaceIncompatible = + accountSettings?.interfaces_for_new_linodes === 'linode_only'; + const { data: allTypes, error: typesError, @@ -488,6 +495,21 @@ export const CreateCluster = () => { variant="error" /> )} + {isInterfaceIncompatible && ( + + + Your account’s{' '} + + Network Interface Type setting is incompatible with LKE + + . To create a cluster, update this setting to allow the option + for Configuration Profile Interfaces.{' '} + + Account settings + + + + )} { ? UNKNOWN_PRICE : highAvailabilityPrice } + isInterfaceIncompatible={isInterfaceIncompatible} pools={nodePools} region={selectedRegion?.id} regionsData={regionsData} diff --git a/packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.test.tsx b/packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.test.tsx index 2be6c62667b..3b93be2a8de 100644 --- a/packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.test.tsx +++ b/packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.test.tsx @@ -55,6 +55,22 @@ describe('KubeCheckoutBar', () => { ); }); + it('should disable create button if Network Interface Type setting is linode only', async () => { + const { getByText } = renderWithThemeAndHookFormContext({ + component: , + useFormOptions: { + defaultValues: { + nodePools: [nodePoolFactory.build()], + }, + }, + }); + + expect(getByText('Create Cluster').closest('button')).toHaveAttribute( + 'aria-disabled', + 'true' + ); + }); + it('should render a section for each pool', async () => { const { queryAllByTestId } = renderWithThemeAndHookFormContext({ component: , diff --git a/packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.tsx b/packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.tsx index 786684b08a0..d1deb2b7eb1 100644 --- a/packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.tsx +++ b/packages/manager/src/features/Kubernetes/KubeCheckoutBar/KubeCheckoutBar.tsx @@ -43,6 +43,7 @@ export interface Props { hasAgreed: boolean; highAvailability?: boolean; highAvailabilityPrice: string; + isInterfaceIncompatible?: boolean; pools: CreateNodePoolData[]; region: string | undefined; regionsData: Region[]; @@ -58,6 +59,7 @@ export const KubeCheckoutBar = (props: Props) => { hasAgreed, highAvailability, highAvailabilityPrice, + isInterfaceIncompatible, pools, region, regionsData, @@ -98,7 +100,8 @@ export const KubeCheckoutBar = (props: Props) => { needsAPool || gdprConditions || (haConditions && !enterprisePrice) || - !region + !region || + isInterfaceIncompatible ); if (isLoading) {