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

Bug 1916882: OCS 4.7 wizard does not show zone when zone's are added manually #7888

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import { humanizeCpuCores, ResourceLink } from '@console/internal/components/uti
import { NodeKind } from '@console/internal/module/k8s';
import { Table } from '@console/internal/components/factory';
import { IRow, sortable } from '@patternfly/react-table';
import { getConvertedUnits, nodesWithoutTaints } from '../../utils/install';
import { getConvertedUnits, nodesWithoutTaints, getZone } from '../../utils/install';
import { cephStorageLabel } from '../../selectors';
import { ZONE_LABELS } from '../../constants';
import { GetRows, NodeTableProps } from './types';
import './ocs-install.scss';

Expand Down Expand Up @@ -45,7 +44,6 @@ const getRows: GetRows = (
const roles = getNodeRoles(node).sort();
const cpuSpec: string = getNodeCPUCapacity(node);
const memSpec: string = getNodeAllocatableMemory(node);
const nodeLabels = node.metadata?.labels;
const cells: IRow['cells'] = [
{
title: <ResourceLink kind="Node" name={getName(node)} title={getName(node)} />,
Expand All @@ -60,7 +58,7 @@ const getRows: GetRows = (
title: `${getConvertedUnits(memSpec)}`,
},
{
title: nodeLabels[ZONE_LABELS[0]] || nodeLabels[ZONE_LABELS[1]] || '-',
title: getZone(node) || '-',
},
];
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import { useSelectList } from '@console/shared/src/hooks/select-list';
import { hasNoTaints } from '../../utils';
import { GetRows } from './types';
import { getZone } from '@console/ceph-storage-plugin/src/utils/install';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't import from the Ceph plugin to LSO plugin that creates a circular dependency. I think you can define a getZone function in LSO plugin itself

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the right path where I can can make this function, instead of importing from ceph plugin??
console/frontend/packages/local-storage-operator-plugin/src/utils/index.ts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds good to me!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, thanks.

import './node-selection-list.scss';

const tableColumnClasses = [
Expand Down Expand Up @@ -60,7 +61,7 @@ const getRows: GetRows = (
title: roles.join(', ') ?? '-',
},
{
title: node.metadata.labels?.['failure-domain.beta.kubernetes.io/zone'] ?? '-',
title: getZone(node) || '-',
},
{
title: `${humanizeCpuCores(cpuSpec).string || '-'}`,
Expand Down