Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNV-41579: Removed featureGate fo memoryOverCommit #1934

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils/hooks/useHyperConvergeConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, never> };
liveMigrationConfig: V1MigrationConfiguration;
resourceRequirements: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,15 +26,10 @@ const MemoryDensity: FC<MemoryDensityProps> = ({ 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,
Expand All @@ -44,16 +41,16 @@ const MemoryDensity: FC<MemoryDensityProps> = ({ hyperConvergeConfiguration, new

if (!hyperLoaded) return <Skeleton width={'300px'} />;

const higherDensity = hyperConverge.spec?.featureGates?.enableHigherDensityWithSwap;
const higherDensity = hyperConverge.spec?.higherWorkloadDensity?.memoryOvercommitPercentage;

return (
<ExpandSection toggleText={t('Memory density')}>
<SectionWithSwitch
helpTextIconContent={t('Configures the VM workloads to use swap for higher density')}
id="memory-density-feature"
isDisabled={!hyperLoaded || !isAdmin || higherDensity === undefined}
isDisabled={!hyperLoaded || !isAdmin}
newBadge={newBadge}
switchIsOn={Boolean(higherDensity)}
switchIsOn={Boolean(higherDensity > MEMORY_OVERCOMMIT_STARTING_VALUE)}
title={t('Enable memory density')}
turnOnSwitch={onChange}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const MEMORY_OVERCOMMIT_STARTING_VALUE = 100;
export const MEMORY_OVERCOMMIT_END_VALUE = 150;
Loading