Skip to content

Commit

Permalink
Merge pull request #11212 from linode/staging
Browse files Browse the repository at this point in the history
Release v1.131.2 - staging → master
  • Loading branch information
bnussman-akamai authored Nov 5, 2024
2 parents db0f640 + a6c1e12 commit 5c9feb0
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 35 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-05] - v1.131.2


### Fixed:

- APL summary panel not being loaded consistently ([#11207](https://github.com/linode/manager/pull/11207))

## [2024-10-29] - v1.131.1


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.131.1",
"version": "1.131.2",
"private": true,
"type": "module",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const APLCopy = () => (
<Typography>
Add a pre-paved path to build, deploy, monitor and secure applications.
<br />
<Link to="https://otomi.io">
<Link to="https://techdocs.akamai.com/cloud-computing/docs/application-platform">
Learn more about Application Platform for LKE.
</Link>
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const CreateCluster = () => {
const regionsData = data ?? [];
const history = useHistory();
const { data: account } = useAccount();
const showAPL = useAPLAvailability();
const { showAPL } = useAPLAvailability();
const { showHighAvailability } = getKubeHighAvailability(account);
const { showControlPlaneACL } = getKubeControlPlaneACL(account);
const [ipV4Addr, setIPv4Addr] = React.useState<ExtendedIP[]>([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,21 @@ const checkConsoleURL = async (
setStatus: React.Dispatch<React.SetStateAction<StatusState>>
) => {
const consoleURL = `https://console.lke${cluster.id}.akamai-apl.net`;

const healthCheckURL = `https://auth.lke${cluster.id}.akamai-apl.net/ready`;
const pollURL = async () => {
try {
const response = await axios.get(consoleURL);
const response = await axios.get(healthCheckURL);

if (response.status === 200) {
if (response.status === 302 || response.status === 200) {
clearInterval(interval); // Stop the polling
setStatus({ resolved: true, url: consoleURL });
}
} catch (error) {
if (error.response && error.response.status === 404) {
setStatus({
message:
'APL is still being deployed, please check back in a minute.',
resolved: false,
});
}
setStatus({
message:
'Installation still in progress; please check back in a minute.',
resolved: false,
});
}
};

Expand Down Expand Up @@ -87,9 +85,7 @@ export const APLSummaryPanel = React.memo((props: Props) => {
<Paper className={classes.root}>
<Grid className={classes.mainGridContainer} container spacing={2}>
<Grid>
<Typography className={classes.label}>
APL Console Endpoint:
</Typography>
<Typography className={classes.label}>Portal Endpoint:</Typography>
{status.resolved ? (
<Link to={status.url}>{status.url}</Link>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const KubernetesClusterDetail = () => {
const { clusterID } = useParams<{ clusterID: string }>();
const id = Number(clusterID);
const location = useLocation();
const showAPL = useAPLAvailability();
const { showAPL } = useAPLAvailability();

const { data: cluster, error, isLoading } = useKubernetesClusterQuery(id);
const { data: regionsData } = useRegionsQuery();
Expand Down Expand Up @@ -117,9 +117,9 @@ export const KubernetesClusterDetail = () => {
<>
<LandingHeader
docsLabel="Docs"
docsLink="https://otomi.io/docs/get-started/overview"
docsLink="https://apl-docs.net/"
removeCrumbX={[1, 2, 3]}
title="Application platform for LKE"
title="Application Platform for LKE"
/>
<Grid>
<APLSummaryPanel cluster={cluster} />
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/src/features/Kubernetes/kubeUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('helper functions', () => {
wrapper: (ui) => wrapWithTheme(ui, { flags: { apl: true } }),
});
await waitFor(() => {
expect(result.current).toBe(true);
expect(result.current.showAPL).toBe(true);
});
});
});
Expand Down
13 changes: 6 additions & 7 deletions packages/manager/src/features/Kubernetes/kubeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,14 @@ export const useAPLAvailability = () => {
const flags = useFlags();

// Only fetch the account beta if the APL flag is enabled
const { data: beta } = useAccountBetaQuery('apl', Boolean(flags.apl));

if (!beta) {
return false;
}
const { data: beta, isLoading } = useAccountBetaQuery(
'apl',
Boolean(flags.apl)
);

const betaStatus = getBetaStatus(beta);
const showAPL = beta !== undefined && getBetaStatus(beta) === 'active';

return betaStatus === 'active';
return { isLoading: flags.apl && isLoading, showAPL };
};

export const getKubeControlPlaneACL = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export const PLAN_NOT_AVAILABLE_IN_REGION_COPY =
"This plan isn't available for the selected region.";
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 APL';
export const PLAN_IS_TOO_SMALL_FOR_APL_COPY =
'This plan is too small for Application Platform for LKE.';

export const LIMITED_AVAILABILITY_LINK =
'https://www.linode.com/global-infrastructure/availability/';
Expand Down
3 changes: 2 additions & 1 deletion packages/manager/src/features/components/PlansPanel/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ export const extractPlansInformation = ({
(disabledPlan) => disabledPlan.id === plan.id
)
);
const planIsTooSmallForAPL = isAPLEnabled && Boolean(plan.memory < 16000);
const planIsTooSmallForAPL =
isAPLEnabled && Boolean(plan.memory < 8000 || plan.vcpus < 4);

return {
...plan,
Expand Down
1 change: 1 addition & 0 deletions packages/manager/src/queries/account/betas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const useCreateAccountBetaMutation = () => {
export const useAccountBetaQuery = (id: string, enabled: boolean = false) => {
return useQuery<AccountBeta, APIError[]>({
enabled,
retry: false,
...accountQueries.betas._ctx.beta(id),
});
};
25 changes: 19 additions & 6 deletions packages/manager/src/queries/kubernetes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ export const kubernetesQueries = createQueryKeys('kubernetes', {
queryFn: () => getKubernetesClusterControlPlaneACL(id),
queryKey: [id],
},
cluster: (useBetaEndpoint: boolean = false) => ({
queryFn: useBetaEndpoint
? () => getKubernetesClusterBeta(id)
: () => getKubernetesCluster(id),
queryKey: [useBetaEndpoint],
}),
dashboard: {
queryFn: () => getKubernetesClusterDashboard(id),
queryKey: null,
Expand Down Expand Up @@ -109,12 +115,11 @@ export const kubernetesQueries = createQueryKeys('kubernetes', {
});

export const useKubernetesClusterQuery = (id: number) => {
const showAPL = useAPLAvailability();
const { isLoading: isAPLAvailabilityLoading, showAPL } = useAPLAvailability();

return useQuery<KubernetesCluster, APIError[]>({
...kubernetesQueries.cluster(id),
queryFn: showAPL
? () => getKubernetesClusterBeta(id) // necessary to call BETA_API_ROOT in a seperate function based on feature flag
: () => getKubernetesCluster(id),
...kubernetesQueries.cluster(id)._ctx.cluster(showAPL),
enabled: !isAPLAvailabilityLoading,
});
};

Expand Down Expand Up @@ -142,7 +147,15 @@ export const useKubernetesClusterMutation = (id: number) => {
queryClient.invalidateQueries({
queryKey: kubernetesQueries.cluster(id)._ctx.acl.queryKey,
});
queryClient.setQueryData(kubernetesQueries.cluster(id).queryKey, data);
// queryClient.setQueryData<KubernetesCluster>(
// kubernetesQueries.cluster(id).queryKey,
// data
// );
// Temporary cache update logic for APL
queryClient.setQueriesData<KubernetesCluster>(
{ queryKey: kubernetesQueries.cluster(id)._ctx.cluster._def },
(oldData) => ({ ...oldData, ...data })
);
},
}
);
Expand Down

0 comments on commit 5c9feb0

Please sign in to comment.