Skip to content

Commit

Permalink
CONSOLE-3243: Rename "master" to "control plane node" in node pages
Browse files Browse the repository at this point in the history
Addresses https://issues.redhat.com/browse/CONSOLE-3243

Changes all string occurences of "master" in the console to "control plane node".
  • Loading branch information
tvu20 committed Aug 5, 2022
1 parent f5cb26c commit f4247fb
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 21 deletions.
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 @@ -171,7 +171,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 @@ -341,7 +341,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 @@ -219,7 +219,7 @@ const UtilizationCardNodeFilter: React.FC<UtilizationCardNodeFilterProps> = ({
const { t } = useTranslation();
const [isOpen, setIsOpen] = React.useState<boolean>(false);
const sortedMCPs = machineConfigPools.sort((a, b) => {
const order = ['worker', 'master'];
const order = ['worker', 'control plane'];
const indexA = order.indexOf(a.metadata.name);
const indexB = order.indexOf(b.metadata.name);
if (indexA === -1 && indexB === -1) {
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
4 changes: 2 additions & 2 deletions frontend/public/module/k8s/cluster-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export const getNotUpgradeableResources = (resources) =>
resources.filter((resource) => getConditionUpgradeableFalse(resource));

export enum NodeTypes {
master = 'master',
master = 'control plane',
worker = 'worker',
}

Expand All @@ -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

0 comments on commit f4247fb

Please sign in to comment.