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

CONSOLE-3243: Rename "master" to "control plane node" in node pages #11927

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions frontend/packages/console-app/locales/en/console-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"Loaded plugins": "Loaded plugins",
"{{enabledCount}}/{{totalCount}} enabled": "{{enabledCount}}/{{totalCount}} enabled",
"View all": "View all",
"Single master": "Single master",
"Single control plane node": "Single control plane node",
"Incompatible file type": "Incompatible file type",
"{{fileName}} cannot be uploaded. Only {{fileExtensions}} files are supported currently. Try another file.": "{{fileName}} cannot be uploaded. Only {{fileExtensions}} files are supported currently. Try another file.",
"Clone": "Clone",
Expand Down Expand Up @@ -343,7 +343,7 @@
"{{formattedCores}} cores / {{totalCores}} cores": "{{formattedCores}} cores / {{totalCores}} cores",
"Ready": "Ready",
"Not Ready": "Not Ready",
"Master": "Master",
"Control plane": "Control plane",
"Worker": "Worker",
"This node's {{conditionDescription}}. Performance may be degraded.": "This node's {{conditionDescription}}. Performance may be degraded.",
"<0>To use host binaries, run <1>chroot /host</1></0>": "<0>To use host binaries, run <1>chroot /host</1></0>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const getControlPlaneHealth: PrometheusHealthHandler = (

const singleMasterMsg =
worstStatus.state === HealthState.OK && isSingleNode(infrastructure)
? t('console-app~Single master')
? t('console-app~Single control plane node')
: undefined;

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ const NodesPage = connect<{}, MapDispatchToProps>(
isMatch: getNodeRoleMatch,
items: [
{
id: 'master',
title: t('console-app~Master'),
id: 'control plane',
title: t('console-app~Control plane'),
},
{
id: 'worker',
Expand Down
8 changes: 6 additions & 2 deletions frontend/packages/console-shared/src/selectors/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const NODE_ROLE_PREFIX = 'node-role.kubernetes.io/';

export const getNodeRoles = (node: NodeKind): string[] => {
const labels = _.get(node, 'metadata.labels');
return _.reduce(
const rolesList = _.reduce(
labels,
(acc: string[], v: string, k: string) => {
if (k.startsWith(NODE_ROLE_PREFIX)) {
Expand All @@ -17,10 +17,14 @@ export const getNodeRoles = (node: NodeKind): string[] => {
},
[],
);
return rolesList.map((e) => {
if (e === 'master') return 'control plane';
return e;
});
};

export const getNodeRole = (node: NodeKind): string =>
getNodeRoles(node).includes('master') ? 'master' : 'worker';
getNodeRoles(node).includes('control plane') ? 'control plane' : 'worker';

export const getNodeRoleMatch = (node: NodeKind, role: string): boolean => {
const roles = getNodeRoles(node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const NodesDisksListPage: React.FC<NodesDisksListPageProps> = ({
const EmptyMsg = () => (
<EmptyState variant={EmptyStateVariant.large}>
<p>{t('lso-plugin~Disks Not Found')}</p>
{csvName && operatorNs && nodeRole !== 'master' && (
{csvName && operatorNs && nodeRole !== 'control plane' && (
<Button
isDisabled={lvdRequestInProgress}
isLoading={lvdRequestInProgress}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
"Pipeline could not be started automatically": "Pipeline could not be started automatically",
"View all {{pipelineRunsLength}}": "View all {{pipelineRunsLength}}",
"Name of the cluster.": "Name of the cluster.",
"Host URL of the master node.": "Host URL of the master node.",
"Host URL of the control plane node.": "Host URL of the control plane node.",
"Username": "Username",
"The user with access to the cluster.": "The user with access to the cluster.",
"Password": "Password",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const PipelineClusterOptions: React.FC<PipelineClusterOptionsProps> = ({ prefixN
type={TextInputTypes.text}
name={`${prefixName}.params.url`}
label={t('pipelines-plugin~URL')}
helpText={t('pipelines-plugin~Host URL of the master node.')}
helpText={t('pipelines-plugin~Host URL of the control plane node.')}
required
/>
<InputField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,12 @@ export const NodesUpdatesGroup: React.FC<NodesUpdatesGroupProps> = ({
kind: referenceForModel(MachineConfigModel),
name: machineConfigPool?.spec?.configuration?.name,
});
const mcpName = machineConfigPool?.metadata?.name;
const machineConfigPoolIsEditable = useAccessReview({
group: MachineConfigPoolModel.apiGroup,
resource: MachineConfigPoolModel.plural,
verb: 'patch',
name,
name: mcpName,
});
const isMaster = isMCPMaster(machineConfigPool);
const isPaused = isMCPPaused(machineConfigPool);
Expand All @@ -644,9 +645,7 @@ export const NodesUpdatesGroup: React.FC<NodesUpdatesGroupProps> = ({
: machineConfigOperatorLoaded && renderedConfigLoaded && (
<UpdatesGroup divided={divided}>
<UpdatesType>
<Link
to={`/k8s/cluster/nodes?rowFilter-node-role=${machineConfigPool?.metadata?.name}`}
>
<Link to={`/k8s/cluster/nodes?rowFilter-node-role=${mcpName}`}>
{`${name} ${NodeModel.labelPlural}`}
</Link>
{!isMaster && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export const DetailsCard = withDashboardResources(
isLoading={false}
valueClassName="co-select-to-copy"
>
{t('public~No (single master)')}
{t('public~No (single control plane node)')}
</OverviewDetailItem>
)}
{detailItemsExtensions.map((e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,26 @@ const UtilizationCardNodeFilter: React.FC<UtilizationCardNodeFilterProps> = ({
});
const onToggle = (open: boolean): void => setIsOpen(open);

const selectedNodesUpdated = selectedNodes.map((item) =>
item === 'master' ? 'control plane' : item,
);

return (
<Select
variant={SelectVariant.checkbox}
aria-label={t('public~Filter by Node type')}
onToggle={onToggle}
onSelect={onNodeSelect}
selections={selectedNodes}
selections={selectedNodesUpdated}
isOpen={isOpen}
placeholderText={t('public~Filter by Node type')}
isPlain
>
{sortedMCPs.map((mcp) => (
<SelectOption key={mcp.metadata.name} value={mcp.metadata.name} />
<SelectOption
key={mcp.metadata.name}
value={mcp.metadata.name === 'master' ? 'control plane' : mcp.metadata.name}
/>
))}
</Select>
);
Expand All @@ -273,10 +280,11 @@ export const UtilizationCard = () => {

// TODO: add `useUserSettingsCompatibility` to store selectedNodes
const onNodeSelect = (event: React.MouseEvent, selection: string) => {
if (selectedNodes.includes(selection)) {
setSelectedNodes(selectedNodes.filter((item) => item !== selection));
const selectionUpdated = selection === 'control plane' ? 'master' : selection;
if (selectedNodes.includes(selectionUpdated)) {
setSelectedNodes(selectedNodes.filter((item) => item !== selectionUpdated));
} else {
setSelectedNodes([...selectedNodes, selection]);
setSelectedNodes([...selectedNodes, selectionUpdated]);
}
};
// if no filter is applied, show all nodes using regex
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/components/modals/cluster-update-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const ClusterUpdateModal = withHandlePromise((props: ClusterUpdateModalProps) =>
{t('public~Update options')}
<FieldLevelHelp>
{t(
"public~Full cluster update allows you to update all your nodes, but takes longer. Partial cluster update allows you to pause worker and custom pool Nodes to accommodate your maintenance schedule, but you'll need to resume the non-master node update within 60 days to avoid failure.",
"public~Full cluster update allows you to update all your nodes, but takes longer. Partial cluster update allows you to pause worker and custom pool Nodes to accommodate your maintenance schedule, but you'll need to resume the non-control plane node update within 60 days to avoid failure.",
)}
</FieldLevelHelp>
</label>
Expand Down
4 changes: 2 additions & 2 deletions frontend/public/locales/en/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
"Infrastructure provider": "Infrastructure provider",
"Update channel": "Update channel",
"Control plane high availability": "Control plane high availability",
"No (single master)": "No (single master)",
"No (single control plane node)": "No (single control plane node)",
"Configure alert receivers": "Configure alert receivers",
"View all steps in documentation": "View all steps in documentation",
"Set up your cluster": "Set up your cluster",
Expand Down Expand Up @@ -777,7 +777,7 @@
"These versions are supported, but not recommended. Review the known risks before updating.": "These versions are supported, but not recommended. Review the known risks before updating.",
"Updating this cluster to {{desiredVersion}} is supported, but not recommended as it might not be optimized for some components in this cluster.": "Updating this cluster to {{desiredVersion}} is supported, but not recommended as it might not be optimized for some components in this cluster.",
"Update options": "Update options",
"Full cluster update allows you to update all your nodes, but takes longer. Partial cluster update allows you to pause worker and custom pool Nodes to accommodate your maintenance schedule, but you'll need to resume the non-master node update within 60 days to avoid failure.": "Full cluster update allows you to update all your nodes, but takes longer. Partial cluster update allows you to pause worker and custom pool Nodes to accommodate your maintenance schedule, but you'll need to resume the non-master node update within 60 days to avoid failure.",
"Full cluster update allows you to update all your nodes, but takes longer. Partial cluster update allows you to pause worker and custom pool Nodes to accommodate your maintenance schedule, but you'll need to resume the non-control plane node update within 60 days to avoid failure.": "Full cluster update allows you to update all your nodes, but takes longer. Partial cluster update allows you to pause worker and custom pool Nodes to accommodate your maintenance schedule, but you'll need to resume the non-control plane node update within 60 days to avoid failure.",
"Full cluster update": "Full cluster update",
"{{master}}, {{worker}}, and custom pool {{resource}} are updated concurrently. This might take longer, so make sure to allocate enough time for maintenance.": "{{master}}, {{worker}}, and custom pool {{resource}} are updated concurrently. This might take longer, so make sure to allocate enough time for maintenance.",
"Paused {{worker}} or custom pool {{resource}} updates will be resumed. If you want to update only the control plane, select \"Partial cluster update\" below.": "Paused {{worker}} or custom pool {{resource}} updates will be resumed. If you want to update only the control plane, select \"Partial cluster update\" below.",
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/module/k8s/cluster-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export enum NodeTypes {
* of the Node names for display purposes
*/
export enum NodeTypeNames {
Master = 'Master',
Master = 'Control plane',
Worker = 'Worker',
}

Expand Down