Skip to content

Commit

Permalink
[BACKPORT 2.20.4][PLAT-14004][Onprem] Universe Creation failed due to…
Browse files Browse the repository at this point in the history
… wrong Image Bundle UUID

Summary: Backport of this [[ https://phorge.dev.yugabyte.com/D35123 | diff ]]

Test Plan: Tested manually

Reviewers: lsangappa, rmadhavan, jmak

Reviewed By: lsangappa

Subscribers: yugaware

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D35190
  • Loading branch information
haikarthikssk authored and svarnau committed May 30, 2024
1 parent 35c518b commit 9ee088f
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useContext } from 'react';
import { useContext, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { useFormContext, useWatch } from 'react-hook-form';
import { Box, Grid, Typography, makeStyles } from '@material-ui/core';
Expand All @@ -22,7 +22,8 @@ import {
import {
PROVIDER_FIELD,
MASTER_PLACEMENT_FIELD,
DEVICE_INFO_FIELD
DEVICE_INFO_FIELD,
LINUX_VERSION_FIELD
} from '../../../utils/constants';
import { useSectionStyles } from '../../../universeMainStyle';
import { CPUArchField } from '../../fields/CPUArchField/CPUArchField';
Expand Down Expand Up @@ -67,7 +68,7 @@ export const InstanceConfiguration = ({ runtimeConfigs }: UniverseFormConfigurat
)?.value;

//form context
const { getValues } = useFormContext<UniverseFormData>();
const { getValues, setValue } = useFormContext<UniverseFormData>();
const { mode, clusterType, newUniverse, universeConfigureTemplate, isViewMode } = useContext(
UniverseFormContext
)[0];
Expand All @@ -83,6 +84,13 @@ export const InstanceConfiguration = ({ runtimeConfigs }: UniverseFormConfigurat
? useWatch({ name: MASTER_PLACEMENT_FIELD })
: getValues(MASTER_PLACEMENT_FIELD);

// Reset Linux version field (ImgBundleUUID) when unsupported provider is selected
useEffect(() => {
if (osPatchingEnabled === 'true' && !isImgBundleSupportedByProvider(provider)) {
setValue(LINUX_VERSION_FIELD, null);
}
}, [provider?.uuid]);

// Wrapper elements to get instance metadata and dedicated container element
const getInstanceMetadataElement = (isDedicatedMasterField: boolean) => {
return (
Expand Down

0 comments on commit 9ee088f

Please sign in to comment.