diff --git a/src/utils/hooks/useHyperConvergeConfiguration.ts b/src/utils/hooks/useHyperConvergeConfiguration.ts index 236d8cd15..e0166e8d8 100644 --- a/src/utils/hooks/useHyperConvergeConfiguration.ts +++ b/src/utils/hooks/useHyperConvergeConfiguration.ts @@ -16,12 +16,12 @@ export type HyperConverged = K8sResourceCommon & { deployTektonTaskResources?: boolean; disableMDevConfiguration?: boolean; enableCommonBootImageImport?: boolean; - enableHigherDensityWithSwap: boolean; nonRoot?: boolean; persistentReservation?: boolean; root?: boolean; withHostPassthroughCPU?: boolean; }; + higherWorkloadDensity: { memoryOvercommitPercentage: number }; ksmConfiguration: { nodeLabelSelector?: Record }; liveMigrationConfig: V1MigrationConfiguration; resourceRequirements: { diff --git a/src/views/clusteroverview/SettingsTab/ClusterTab/components/GeneralSettings/MemoryDensity/MemoryDensity.tsx b/src/views/clusteroverview/SettingsTab/ClusterTab/components/GeneralSettings/MemoryDensity/MemoryDensity.tsx index e560a41e6..d7a2d9577 100644 --- a/src/views/clusteroverview/SettingsTab/ClusterTab/components/GeneralSettings/MemoryDensity/MemoryDensity.tsx +++ b/src/views/clusteroverview/SettingsTab/ClusterTab/components/GeneralSettings/MemoryDensity/MemoryDensity.tsx @@ -10,6 +10,8 @@ import { Skeleton } from '@patternfly/react-core'; import ExpandSection from '../../../../ExpandSection/ExpandSection'; +import { MEMORY_OVERCOMMIT_END_VALUE, MEMORY_OVERCOMMIT_STARTING_VALUE } from './utils/const'; + type MemoryDensityProps = { hyperConvergeConfiguration: [hyperConvergeConfig: HyperConverged, loaded: boolean, error: any]; newBadge: boolean; @@ -24,15 +26,10 @@ const MemoryDensity: FC = ({ hyperConvergeConfiguration, new (checked: boolean) => { k8sPatch({ data: [ - { - op: 'replace', - path: `/spec/featureGates/enableHigherDensityWithSwap`, - value: checked, - }, { op: 'replace', path: `/spec/higherWorkloadDensity/memoryOvercommitPercentage`, - value: checked ? 150 : 100, + value: checked ? MEMORY_OVERCOMMIT_END_VALUE : MEMORY_OVERCOMMIT_STARTING_VALUE, }, ], model: HyperConvergedModel, @@ -44,16 +41,16 @@ const MemoryDensity: FC = ({ hyperConvergeConfiguration, new if (!hyperLoaded) return ; - const higherDensity = hyperConverge.spec?.featureGates?.enableHigherDensityWithSwap; + const higherDensity = hyperConverge.spec?.higherWorkloadDensity?.memoryOvercommitPercentage; return ( MEMORY_OVERCOMMIT_STARTING_VALUE)} title={t('Enable memory density')} turnOnSwitch={onChange} /> diff --git a/src/views/clusteroverview/SettingsTab/ClusterTab/components/GeneralSettings/MemoryDensity/utils/const.ts b/src/views/clusteroverview/SettingsTab/ClusterTab/components/GeneralSettings/MemoryDensity/utils/const.ts new file mode 100644 index 000000000..714c0f4a7 --- /dev/null +++ b/src/views/clusteroverview/SettingsTab/ClusterTab/components/GeneralSettings/MemoryDensity/utils/const.ts @@ -0,0 +1,2 @@ +export const MEMORY_OVERCOMMIT_STARTING_VALUE = 100; +export const MEMORY_OVERCOMMIT_END_VALUE = 150;