Skip to content

Commit

Permalink
hotfix: APL-354 to staging (#11284)
Browse files Browse the repository at this point in the history
* hotfix: APL-354 to staging

* package bump and changelog update

---------

Co-authored-by: Alban Bailly <[email protected]>
  • Loading branch information
dennisvankekem and abailly-akamai authored Nov 19, 2024
1 parent 060af91 commit cf10a8d
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 10 deletions.
7 changes: 7 additions & 0 deletions packages/manager/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## [2024-11-19] - v1.132.1


### Fixed:

- Disable shared CPU whenever APL is enabled ([#11284](https://github.com/linode/manager/pull/11284))

## [2024-11-12] - v1.132.0


Expand Down
2 changes: 1 addition & 1 deletion packages/manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "linode-manager",
"author": "Linode",
"description": "The Linode Manager website",
"version": "1.132.0",
"version": "1.132.1",
"private": true,
"type": "module",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export const KubernetesPlansPanel = (props: Props) => {
Boolean(flags.soldOutChips) && selectedRegionId !== undefined
);

const isPlanDisabledByAPL = (plan: 'shared' | LinodeTypeClass) =>
plan === 'shared' && Boolean(isAPLEnabled);

const _types = types.filter(
(type) =>
!type.id.includes('dedicated-edge') && !type.id.includes('nanode-edge')
Expand Down Expand Up @@ -105,10 +108,14 @@ export const KubernetesPlansPanel = (props: Props) => {
)}
hasMajorityOfPlansDisabled={hasMajorityOfPlansDisabled}
hasSelectedRegion={hasSelectedRegion}
isAPLEnabled={isAPLEnabled}
planType={plan}
regionsData={regionsData}
/>
<KubernetesPlanContainer
wholePanelIsDisabled={
isPlanPanelDisabled(plan) || isPlanDisabledByAPL(plan)
}
allDisabledPlans={allDisabledPlans}
getTypeCount={getTypeCount}
hasMajorityOfPlansDisabled={hasMajorityOfPlansDisabled}
Expand All @@ -118,7 +125,6 @@ export const KubernetesPlansPanel = (props: Props) => {
selectedId={selectedId}
selectedRegionId={selectedRegionId}
updatePlanCount={updatePlanCount}
wholePanelIsDisabled={isPlanPanelDisabled(plan)}
/>
</>
);
Expand Down
19 changes: 19 additions & 0 deletions packages/manager/src/features/components/PlansPanel/APLNotice.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react';

import { Notice } from 'src/components/Notice/Notice';

import { APL_NOTICE_COPY } from './constants';

interface Props {
dataTestId?: string;
}

export const APLNotice = (props: Props) => {
const { dataTestId } = props;

return (
<Notice dataTestId={dataTestId} variant="error">
{APL_NOTICE_COPY}
</Notice>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type { PlanInformationProps } from './PlanInformation';
const mockProps: PlanInformationProps = {
hasMajorityOfPlansDisabled: false,
hasSelectedRegion: true,
isAPLEnabled: true,
isSelectedRegionEligibleForPlan: false,
planType: 'standard',
};
Expand All @@ -28,6 +29,12 @@ describe('PlanInformation', () => {
expect(element).toBeInTheDocument();
});

it('should render APLNotice when planType is "shared" and APL is enabled', () => {
renderWithTheme(<PlanInformation {...mockProps} planType="shared" />);
const element = screen.getByTestId('apl-notice');
expect(element).toBeInTheDocument();
});

it('should render MetalNotice when planType is "metal"', () => {
renderWithTheme(<PlanInformation {...mockProps} planType="metal" />);
const element = screen.getByTestId('metal-notice');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Typography } from 'src/components/Typography';
import { StyledNoticeTypography } from 'src/features/components/PlansPanel/PlansAvailabilityNotice.styles';
import { useFlags } from 'src/hooks/useFlags';

import { APLNotice } from './APLNotice';
import {
DEDICATED_COMPUTE_INSTANCES_LINK,
GPU_COMPUTE_INSTANCES_LINK,
Expand All @@ -21,13 +22,17 @@ import type { Region } from '@linode/api-v4';
import type { LinodeTypeClass } from '@linode/api-v4/lib/linodes';
import type { Theme } from '@mui/material/styles';

export interface PlanInformationProps {
interface ExtendedPlanType {
planType: 'shared' | LinodeTypeClass;
}

export interface PlanInformationProps extends ExtendedPlanType {
disabledClasses?: LinodeTypeClass[];
hasMajorityOfPlansDisabled: boolean;
hasSelectedRegion: boolean;
hideLimitedAvailabilityBanner?: boolean;
isAPLEnabled?: boolean;
isSelectedRegionEligibleForPlan: boolean;
planType: LinodeTypeClass;
regionsData?: Region[];
}

Expand All @@ -37,6 +42,7 @@ export const PlanInformation = (props: PlanInformationProps) => {
hasMajorityOfPlansDisabled,
hasSelectedRegion,
hideLimitedAvailabilityBanner,
isAPLEnabled,
isSelectedRegionEligibleForPlan,
planType,
regionsData,
Expand Down Expand Up @@ -100,6 +106,9 @@ export const PlanInformation = (props: PlanInformationProps) => {
hasDisabledClass={getDisabledClass('metal')}
/>
) : null}
{planType === 'shared' && isAPLEnabled ? (
<APLNotice dataTestId="apl-notice" />
) : null}
{planType === 'premium' ? (
<PlansAvailabilityNotice
hasSelectedRegion={hasSelectedRegion}
Expand Down Expand Up @@ -134,11 +143,7 @@ export const PlanInformation = (props: PlanInformationProps) => {

export const limitedAvailabilityBannerTestId = 'limited-availability-banner';

interface ClassDescriptionCopyProps {
planType: 'shared' | LinodeTypeClass;
}

export const ClassDescriptionCopy = (props: ClassDescriptionCopyProps) => {
export const ClassDescriptionCopy = (props: ExtendedPlanType) => {
const { planType } = props;
let planTypeLabel: null | string;
let docLink: null | string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export const PLAN_IS_CURRENTLY_UNAVAILABLE_COPY =
'This plan is currently unavailable.';
export const PLAN_IS_TOO_SMALL_FOR_APL_COPY =
'This plan is too small for Application Platform for LKE.';
export const APL_NOTICE_COPY =
'Shared CPU instances are currently not available for Application Platform for LKE';

export const LIMITED_AVAILABILITY_LINK =
'https://www.linode.com/global-infrastructure/availability/';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export const extractPlansInformation = ({
)
);
const planIsTooSmallForAPL =
isAPLEnabled && Boolean(plan.memory < 8000 || plan.vcpus < 4);
isAPLEnabled && Boolean(plan.memory < 16000 || plan.vcpus < 4);

return {
...plan,
Expand Down

0 comments on commit cf10a8d

Please sign in to comment.