Skip to content
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
21 changes: 0 additions & 21 deletions libs/locales/lib/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"ai:Allocate IPs via DHCP server": "Allocate IPs using DHCP server",
"ai:Already approved": "Already approved",
"ai:Also note that each host's disk write speed should meet the minimum requirements to run OpenShift. ": "Also note that the disk write speed of each host must meet the minimum requirements to run OpenShift. ",
"ai:AMD GPU": "AMD GPU",
"ai:AMD GPU requirements": "AMD GPU requirements",
"ai:An error occured": "An error occured.",
"ai:An error occured while approving agents": "An error occured while approving agents.",
Expand All @@ -108,7 +107,6 @@
"ai:arm64 is not supported in this OpenShift version": "arm64 is not supported in this OpenShift version",
"ai:At least 3 hosts are required, capable of functioning as control plane nodes.": "At least 3 hosts are required that are capable of functioning as control plane nodes.",
"ai:Authentication is provided by the discovery ISO, therefore when you access your host using SSH, a password is not required. Optional -i parameter can be used to specify the private key that matches the public key provided when generating Discovery ISO.": "Authentication is provided by the Discovery ISO, so a password is not required when you access your host using SSH. The optional -i parameter can be used to specify the private key that matches the public key that is provided when generating Discovery ISO.",
"ai:Authorino": "Authorino",
"ai:Auto synchronized NTP (Network Time Protocol) sources": "Auto synchronized NTP (Network Time Protocol) sources",
"ai:Auto-assign": "Auto-assign",
"ai:Auto-select hosts": "Auto-select hosts",
Expand Down Expand Up @@ -342,7 +340,6 @@
"ai:Failed to update the AgentServiceConfig": "Failed to update the AgentServiceConfig",
"ai:Failed validations:": "Failed validations:",
"ai:Failing infrastructure environment": "Failing infrastructure environment",
"ai:Fence Agents Remediation": "Fence Agents Remediation",
"ai:Fence Agents Remediation requirements": "Fence Agents Remediation requirements",
"ai:File is not structured correctly. Use the template to use the right file structure.": "File is not structured correctly. Use the template to use the right file structure.",
"ai:File size is too big. Upload a new {{maxFileSizeKb}} Kb or less.": "File size is too big. Upload a new file that is {{maxFileSizeKb}} Kb or less.",
Expand Down Expand Up @@ -483,9 +480,7 @@
"ai:Keep the Discovery ISO media connected to the device throughout the installation process and set each host to boot <bold>only one time</bold> from this device. ": "Keep the Discovery ISO media connected to the device throughout the installation process and set each host to boot <bold>only one time</bold> from this device. ",
"ai:Keep the Discovery ISO media connected to the device throughout the installation process and set each host to boot <bold>only one time</bold> from this device. _plural": "Keep the Discovery ISO media connected to the device throughout the installation process and set each host to boot <bold>only one time</bold> from this device. ",
"ai:Keep the field empty to match <bold>any</bold> location.": "Keep the field empty to match <bold>any</bold> location.",
"ai:Kernel Module Management": "Kernel Module Management",
"ai:Kernel Module Management requirements": "Kernel Module Management requirements",
"ai:Kube Descheduler": "Kube Descheduler",
"ai:Kube Descheduler requirements": "Kube Descheduler requirements",
"ai:Kubeconfig is empty.": "Kubeconfig is empty.",
"ai:Labels": "Labels",
Expand All @@ -507,9 +502,7 @@
"ai:Loading proxy configuration": "Loading proxy configuration",
"ai:Location": "Location",
"ai:Location is a required field.": "Location is a required field.",
"ai:Logical Volume Manager": "Logical Volume Manager",
"ai:Logical Volume Manager requirements": "Logical Volume Manager requirements",
"ai:Logical Volume Manager Storage": "Logical Volume Manager Storage",
"ai:LSO requirements": "LSO requirements",
"ai:MAC address": "MAC address",
"ai:MAC has to be specified": "MAC must be specified",
Expand All @@ -534,7 +527,6 @@
"ai:Memory capacity": "Memory capacity",
"ai:Message": "Message",
"ai:Metal3 operator is not configured": "Metal3 operator is not configured",
"ai:Migration Toolkit for Virtualization": "Migration Toolkit for Virtualization",
"ai:Migration toolkit for virtualization requirements": "Migration toolkit for virtualization requirements",
"ai:Minimal image file": "Minimal image file",
"ai:Minimal value is 10Gi": "Minimal value is 10Gi",
Expand All @@ -555,7 +547,6 @@
"ai:More info for system storage": "More information for system storage",
"ai:MTU (maximum transmission unit) failure": "MTU (maximum transmission unit) failure",
"ai:MTU requirements": "MTU requirements",
"ai:Multicluster engine": "Multicluster engine",
"ai:Multicluster engine requirements": "Multicluster engine requirements",
"ai:Must be at least 1": "Must be at least 1",
"ai:Must be unique": "Must be unique",
Expand Down Expand Up @@ -602,11 +593,8 @@
"ai:No subnets are currently available": "No subnets are currently available",
"ai:No support level data for version {{openshiftVersion}}": "No support level data for version {{openshiftVersion}}",
"ai:No version selected": "No version selected",
"ai:Node Feature Discovery": "Node Feature Discovery",
"ai:Node Feature Discovery requirements": "Node Feature Discovery requirements",
"ai:Node Healthcheck": "Node Healthcheck",
"ai:Node Healthcheck requirements": "Node Healthcheck requirements",
"ai:Node Maintenace": "Node Maintenace",
"ai:Node Maintenance requirements": "Node Maintenance requirements",
"ai:Nodepool": "Nodepool",
"ai:Nodepool conditions": "Nodepool conditions",
Expand All @@ -627,7 +615,6 @@
"ai:Number of characters between dots (.) must be 1-63": "Number of characters between dots (.) must be 1-63",
"ai:Number of control plane nodes": "Number of control plane nodes",
"ai:Number of hosts": "Number of hosts",
"ai:NVIDIA GPU": "NVIDIA GPU",
"ai:NVIDIA GPU requirements": "NVIDIA GPU requirements",
"ai:OCS requirements": "OCS requirements",
"ai:ODF requirements": "ODF requirements",
Expand All @@ -642,15 +629,11 @@
"ai:Open Virtual Networking (OVN)": "Open Virtual Networking (OVN)",
"ai:Opening file": "Opening file",
"ai:OpenShift": "OpenShift",
"ai:OpenShift AI": "OpenShift AI",
"ai:OpenShift AI requirements": "OpenShift AI requirements",
"ai:OpenShift Cluster Manager": "OpenShift Cluster Manager",
"ai:OpenShift Data Foundation": "OpenShift Data Foundation",
"ai:OpenShift in-place upgrades aren't expected to work with SNO. If an upgrade is needed, your system will need a redeployment.": "OpenShift in-place upgrades are not expected to work with SNO. If an upgrade is needed, your system to be redeployed.",
"ai:OpenShift sandboxed containers": "OpenShift sandboxed containers",
"ai:OpenShift sandboxed containers requirements": "OpenShift sandboxed containers requirements",
"ai:OpenShift version": "OpenShift version",
"ai:OpenShift Virtualization": "OpenShift Virtualization",
"ai:OpenShift Web Console troubleshooting": "OpenShift Web Console troubleshooting",
"ai:Operators": "Operators",
"ai:Option 1: Add the following records to your DNS server (recommended)": "Option 1: Add the following records to your DNS server (recommended)",
Expand All @@ -667,7 +650,6 @@
"ai:Pending input": "Pending input",
"ai:Pending user action": "Pending user action",
"ai:Pending validations:": "Pending validations:",
"ai:Pipelines": "Pipelines",
"ai:Pipelines requirements": "Pipelines requirements",
"ai:Platform network settings": "Platform network settings",
"ai:Platform requirements": "Platform requirements",
Expand Down Expand Up @@ -748,14 +730,11 @@
"ai:Select one or multiple locations to choose the hosts from.": "Select one or multiple locations of the hosts.",
"ai:selected": "selected",
"ai:Selected image does not support arm64": "Selected image does not support arm64",
"ai:Self Node Remediation": "Self Node Remediation",
"ai:Self Node Remediation requirements": "Self Node Remediation requirements",
"ai:Serial": "Serial",
"ai:Serial number": "Serial number",
"ai:Serverless": "Serverless",
"ai:Serverless requirements": "Serverless requirements",
"ai:Service CIDR": "Service CIDR",
"ai:Service Mesh": "Service Mesh",
"ai:Service Mesh requirements": "Service Mesh requirements",
"ai:Service network CIDR": "Service network CIDR",
"ai:Service networks": "Service networks",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { commonActions } from '../../../views/common';
import OperatorsForm from '../../../views/forms/Operators/OperatorsForm';
import { operatorsPage } from '../../../views/operatorsPage';

describe(`Create cluster with MTV operator enabled`, () => {
const setTestStartSignal = (activeSignal: string) => {
Expand All @@ -15,6 +16,7 @@ describe(`Create cluster with MTV operator enabled`, () => {
setTestStartSignal('CLUSTER_CREATED');
commonActions.visitClusterDetailsPage();
commonActions.startAtWizardStep('Operators');
operatorsPage.singleOperatorsToggle().click();
});

describe('When the feature is enabled:', () => {
Expand All @@ -28,8 +30,8 @@ describe(`Create cluster with MTV operator enabled`, () => {
cy.wait('@update-cluster').then(({ request }) => {
expect(request.body.olm_operators).to.deep.equal([
{ name: 'cnv' },
{ name: 'mtv' },
{ name: 'lso' },
{ name: 'mtv' },
]);
});
});
Expand Down
16 changes: 16 additions & 0 deletions libs/ui-lib-tests/cypress/support/interceptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const getDay2ClusterApiPath = () => `${allClustersApiPath}${day2FlowIds.day2.aiC
const day2InfraEnvDetailsUrl = new RegExp(
`${getDay2InfraEnvApiPath(x86)}|${getDay2InfraEnvApiPath(arm)}`,
);
const getDay1ClusterPreflightRequirementsApiPath = () => `${allClustersApiPath}${Cypress.env('clusterId')}/preflight-requirements`;

const getDay2InfraEnv = (cpuArch: Archs) => fixtures.day2InfraEnvs[cpuArch];
const getCpuArchitectureParam = (cpuArch: string): Archs | undefined => {
Expand Down Expand Up @@ -207,6 +208,20 @@ const addClusterListIntercepts = () => {
});
};

const addPreflightRequirementsIntercepts = () => {
const clusterReqApiPath = getDay1ClusterPreflightRequirementsApiPath();
cy.intercept('GET', clusterReqApiPath, { operators: [
{
operatorName: 'mtv',
dependencies: ['cnv']
},
{
operatorName: 'cnv',
dependencies: ['lso']
}
] }).as('cluster-req');
}

const addClusterPatchAndDetailsIntercepts = () => {
const clusterApiPath = getDay1ClusterApiPath();
cy.intercept('GET', clusterApiPath, mockClusterResponse).as('cluster-details');
Expand Down Expand Up @@ -470,6 +485,7 @@ const loadDay1Intercepts = () => {
addDay1InfraEnvIntercepts();
addDay1HostIntercepts();
addEventsIntercepts();
addPreflightRequirementsIntercepts();
};

const loadDay2Intercepts = () => {
Expand Down
4 changes: 2 additions & 2 deletions libs/ui-lib-tests/cypress/support/variables/host-discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Cypress.env(
);
Cypress.env(
'useContainerNativeVirtualizationField',
'#form-checkbox-useContainerNativeVirtualization-field',
'#form-input-cnv-field',
);
Cypress.env('useOpenShiftDataFoundation', '#form-checkbox-useOpenShiftDataFoundation-field');
Cypress.env('useOpenShiftDataFoundation', '#form-input-odf-field');
Cypress.env('useOdfLogicalVolumeManagerField', '#form-checkbox-useOdfLogicalVolumeManager-field');
Cypress.env('integrateWithVsphere', 'Integrate with vSphere');
3 changes: 0 additions & 3 deletions libs/ui-lib-tests/cypress/views/bareMetalDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ export const bareMetalDiscoveryPage = {
getOdfOperator: () => {
return cy.get(Cypress.env('useOpenShiftDataFoundation'));
},
getLvmOperator: () => {
return cy.get(Cypress.env('useOdfLogicalVolumeManagerField'));
},
platformIntegration: {
getFullPotentialHint: () => {
return cy.get('[data-testid="discover-platform-integration-hosts"]', { timeout: 16000 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class OperatorsForm {
/** @private */
class MceOperatorControl {
static get body() {
return OperatorsForm.body.find('#form-control__form-checkbox-useMultiClusterEngine-field');
return OperatorsForm.body.find('#form-control__form-input-mce-field');
}

static findPopoverButton() {
Expand All @@ -25,7 +25,7 @@ class MceOperatorControl {
}

static findPopoverContent() {
return MceOperatorControl.body.scrollIntoView().get('#popover-useMultiClusterEngine-body');
return MceOperatorControl.body.scrollIntoView().get('#popover-mce-body');
}

static findLabel() {
Expand All @@ -43,7 +43,7 @@ class MceOperatorControl {
class MtvOperatorControl {
static get body() {
return OperatorsForm.body.find(
'#form-control__form-checkbox-useMigrationToolkitforVirtualization-field',
'#form-control__form-input-mtv-field',
);
}

Expand All @@ -56,7 +56,7 @@ class MtvOperatorControl {
static findPopoverContent() {
return MtvOperatorControl.body
.scrollIntoView()
.get('#popover-useMigrationToolkitforVirtualization-body');
.get('#popover-mtv-body');
}

static findLabel() {
Expand Down
2 changes: 1 addition & 1 deletion libs/ui-lib-tests/cypress/views/operatorsPage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const operatorsPage = {
openshiftVirtualization: () => {
return cy.get('#form-checkbox-useContainerNativeVirtualization-field');
return cy.get('#form-input-cnv-field');
},
singleOperatorsToggle: () => {
return cy.contains('Single Operators ');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import {
import { ClusterImageSetK8sResource } from '../../types';
import { featureSupportLevelsACM } from '../../config/constants';
import { getFeatureDisabledReason, isFeatureSupported } from './featureStateUtils';
import { getOCPVersions, getVersionFromReleaseImage, getMajorMinorVersion } from '../helpers';
import { getOCPVersions, getVersionFromReleaseImage } from '../helpers';
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
import { SupportLevel } from '@openshift-assisted/types/assisted-installer-service';
import { getMajorMinorVersion } from '../../../common/utils';

export type ACMFeatureSupportLevelProvider = PropsWithChildren<{
clusterImages: ClusterImageSetK8sResource[];
Expand Down
6 changes: 1 addition & 5 deletions libs/ui-lib/lib/cim/components/helpers/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from '../../types';
import { CpuArchitecture, OpenshiftVersionOptionType } from '../../../common';
import { OpenshiftVersion } from '@openshift-assisted/types/assisted-installer-service';
import { getMajorMinorVersion } from '../../../common/utils';

export const getVersionFromReleaseImage = (releaseImage = '') => {
const match = /.+:(.*)/gm.exec(releaseImage);
Expand Down Expand Up @@ -120,11 +121,6 @@ export const getSelectedVersion = (
export const getCurrentClusterVersion = (cv?: ClusterVersionK8sResource): string | undefined =>
cv?.status?.history?.[0]?.version || cv?.spec?.desiredUpdate?.version;

export const getMajorMinorVersion = (version = '') => {
const match = /[0-9].[0-9][0-9]?/g.exec(version);
return match?.[0] || '';
};

export const getNetworkType = (
ocpVersion: OpenshiftVersionOptionType | undefined,
): 'OVNKubernetes' | 'OpenShiftSDN' =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ const ClusterProgressItems = ({
</GridItem>
<RenderIf condition={olmOperators.length > 0}>
<GridItem span={3}>
<OperatorsProgressItem
operators={olmOperators}
openshiftVersion={cluster.openshiftVersion}
/>
<OperatorsProgressItem operators={olmOperators} />
</GridItem>
</RenderIf>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ import { global_success_color_100 as okColor } from '@patternfly/react-tokens/di
import { pluralize } from 'humanize-plus';
import { TFunction } from 'i18next';
import {
Cluster,
MonitoredOperator,
MonitoredOperatorsList,
OperatorStatus,
} from '@openshift-assisted/types/assisted-installer-service';
import { operatorLabelsCim, OperatorName } from '../../config';
import ClusterProgressItem from './ClusterProgressItem';
import { useTranslation } from '../../hooks/use-translation-wrapper';
import { useFeatureSupportLevel } from '../featureSupportLevels';
import { useOperatorSpecs } from '../operators/operatorSpecs';

import './OperatorsProgressItem.css';

Expand Down Expand Up @@ -74,16 +72,15 @@ export function getOperatorsIcon(status: OperatorStatus | 'pending') {

type OperatorListProps = {
operators: MonitoredOperatorsList;
openshiftVersion: Cluster['openshiftVersion'];
};

type OperatorsPopoverProps = OperatorListProps & {
children: React.ComponentProps<typeof Popover>['children'];
};

const OperatorsPopover = ({ operators, openshiftVersion, children }: OperatorsPopoverProps) => {
const OperatorsPopover = ({ operators, children }: OperatorsPopoverProps) => {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
const { t } = useTranslation();
const featureSupportLevel = useFeatureSupportLevel();
const opSpecs = useOperatorSpecs();

return (
<Popover
Expand All @@ -95,10 +92,7 @@ const OperatorsPopover = ({ operators, openshiftVersion, children }: OperatorsPo
if (operator.status === 'available') {
status = 'installed';
}
const name =
operatorLabelsCim(t, openshiftVersion, featureSupportLevel)[
operator.name as OperatorName
] || operator.name;
const name = opSpecs[operator.name || '']?.title || operator.name;
return (
<ListItem key={operator.name} title={operator.statusInfo}>
{name} {status}
Expand All @@ -115,14 +109,14 @@ const OperatorsPopover = ({ operators, openshiftVersion, children }: OperatorsPo
);
};

const OperatorsProgressItem = ({ operators, openshiftVersion }: OperatorListProps) => {
const OperatorsProgressItem = ({ operators }: OperatorListProps) => {
const { t } = useTranslation();
const icon = getOperatorsIcon(getAggregatedStatus(operators));
const label = getOperatorsLabel(operators, t);
return (
<ClusterProgressItem icon={icon}>
<>
<OperatorsPopover operators={operators} openshiftVersion={openshiftVersion}>
<OperatorsPopover operators={operators}>
<Button variant={ButtonVariant.link} isInline data-testid="operators-progress-item">
{t('ai:Operators')}
</Button>
Expand Down
6 changes: 3 additions & 3 deletions libs/ui-lib/lib/common/components/clusterWizard/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ export type ValidationActionLinkProps<S extends string> = {
wizardStepNames: { [key in S]: string };
};

export type ClusterOperatorProps = Pick<Cluster, 'openshiftVersion'> & {
clusterId: Cluster['id'];
} & { monitoredOperators?: Cluster['monitoredOperators'] };
export type ClusterOperatorProps = {
cluster: Cluster;
};

export type ItemDropdown = {
label: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export type NewFeatureSupportLevelData = {
getFeatureSupportLevel: GetFeatureSupportLevel;
isFeatureDisabled(featureId: FeatureId, supportLevelData?: NewFeatureSupportLevelMap): boolean;
getFeatureDisabledReason: GetFeatureDisabledReason;
isFeatureSupported(featureId: FeatureId, supportLevelData?: NewFeatureSupportLevelMap): boolean;
isFeatureSupported: (
featureId: FeatureId,
supportLevelData?: NewFeatureSupportLevelMap,
) => boolean;
activeFeatureConfiguration?: ActiveFeatureConfiguration;
};
Loading
Loading