diff --git a/ui/apps/everest/.e2e/pr/db-cluster/db-wizard/create-db-cluster/affinity.e2e.ts b/ui/apps/everest/.e2e/pr/db-cluster/db-wizard/create-db-cluster/affinity.e2e.ts index 023f8d1b3..a279a3c7a 100644 --- a/ui/apps/everest/.e2e/pr/db-cluster/db-wizard/create-db-cluster/affinity.e2e.ts +++ b/ui/apps/everest/.e2e/pr/db-cluster/db-wizard/create-db-cluster/affinity.e2e.ts @@ -5,7 +5,7 @@ import { findDbAndClickRow } from '@e2e/utils/db-clusters-list'; import { deleteDbClusterFn } from '@e2e/utils/db-cluster'; type AffinityRuleFormArgs = { - component?: 'DB Node' | 'Proxy' | 'Config Server'; + component?: 'DB Node' | 'Proxy' | 'Router' | 'PG Bouncer' | 'Config Server'; type?: 'Node affinity' | 'Pod affinity' | 'Pod anti-affinity'; preference?: 'preferred' | 'required'; weight?: string; @@ -154,7 +154,7 @@ test.describe('Affinity via wizard', () => { values: 'val1, val2', }); await addAffinityRule(page, { - component: 'Proxy', + component: 'Router', type: 'Pod affinity', preference: 'required', topologyKey: 'my-topology-key', diff --git a/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/affinity-form.tsx b/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/affinity-form.tsx index 60c098736..7a97abd97 100644 --- a/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/affinity-form.tsx +++ b/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/affinity-form.tsx @@ -78,6 +78,7 @@ export const AffinityForm = () => { operator={operator} disableOperator={!key} disableValue={!key} + affinityType={type} /> ); diff --git a/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/fields/key-input.tsx b/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/fields/key-input.tsx index a5da7986e..60734de24 100644 --- a/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/fields/key-input.tsx +++ b/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/fields/key-input.tsx @@ -1,7 +1,17 @@ import { TextInput } from '@percona/ui-lib'; import { AffinityFormFields } from '../affinity-form.types'; +import { AffinityType } from 'shared-types/affinity.types'; -const KeyInput = () => ( +const getHelperTextForAffinityType = (affinityType: AffinityType) => { + switch (affinityType) { + case AffinityType.NodeAffinity: + return 'A label key assigned to nodes that defines scheduling rules'; + default: + return 'A label key assigned to pods that defines scheduling rules'; + } +}; + +const KeyInput = ({ affinityType }: { affinityType: AffinityType }) => ( ( sx: { flex: '0 0 35%', }, - helperText: - 'A label key on pods used to determine the targets for applying affinity or anti-affinity rules', + helperText: getHelperTextForAffinityType(affinityType), }} /> ); diff --git a/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/fields/topology-key-input.tsx b/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/fields/topology-key-input.tsx index 265f5ac9f..dccf617da 100644 --- a/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/fields/topology-key-input.tsx +++ b/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/fields/topology-key-input.tsx @@ -9,8 +9,7 @@ const TopologyKeyInput = () => ( sx: { flex: '0 0 35%', }, - helperText: - 'A label key on nodes that defines the grouping or topology scope (e.g., zone, hostname) where the rules are enforced', + helperText: 'A domain key that determines relative pod placement', }} /> ); diff --git a/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/sections/details-section.tsx b/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/sections/details-section.tsx index e543fcb61..91add2a7b 100644 --- a/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/sections/details-section.tsx +++ b/ui/apps/everest/src/components/cluster-form/affinity/affinity-form-dialog/affinity-form/sections/details-section.tsx @@ -5,13 +5,14 @@ import { TopologyKeyInput, ValueInput, } from '../fields'; -import { AffinityOperator } from 'shared-types/affinity.types'; +import { AffinityOperator, AffinityType } from 'shared-types/affinity.types'; type Props = { disableOperator: boolean; disableValue: boolean; operator: AffinityOperator; showTopologyKey: boolean; + affinityType: AffinityType; }; const RuleDetailsSection = ({ @@ -19,6 +20,7 @@ const RuleDetailsSection = ({ disableOperator, disableValue, showTopologyKey, + affinityType, }: Props) => ( <> @@ -26,7 +28,7 @@ const RuleDetailsSection = ({ {showTopologyKey && } - + {[AffinityOperator.In, AffinityOperator.NotIn].includes(operator) && (