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
40 changes: 40 additions & 0 deletions libs/ui-lib/lib/common/components/operators/operatorSpecs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ import {
OPERATOR_NAME_PIPELINES,
OPERATOR_NAME_SERVERLESS,
OPERATOR_NAME_SERVICEMESH,
OPERATOR_NAME_NODE_HEALTHCHECK,
OPERATOR_NAME_FENCE_AGENTS_REMEDIATION,
OPERATOR_NAME_NODE_MAINTENANCE,
OPERATOR_NAME_KUBE_DESCHEDULER,
} from '../../config/constants';
import { ExternalLink } from '../ui';
import {
AUTHORINO_OPERATOR_LINK,
CNV_LINK,
FENCE_AGENTS_REMEDIATION_LINK,
getKmmDocsLink,
getKubeDeschedulerLink,
getLsoLink,
Expand All @@ -35,6 +38,7 @@ import {
getNodeFeatureDiscoveryLink,
getNvidiaGpuLink,
MTV_LINK,
NODE_HEALTHCHECK_LINK,
NODE_MAINTENANCE_LINK,
ODF_LINK,
ODF_REQUIREMENTS_LINK,
Expand All @@ -54,11 +58,13 @@ import {
DESCRIPTION_LSO,
DESCRIPTION_MTV,
DESCRIPTION_CNV,
DESCRIPTION_FENCE_AGENTS_REMEDIATION,
DESCRIPTION_KMM,
DESCRIPTION_KUBE_DESCHEDULER,
DESCRIPTION_MCE,
DESCRIPTION_NMSTATE,
DESCRIPTION_NODE_FEATURE_DISCOVERY,
DESCRIPTION_NODE_HEALTHCHECK,
DESCRIPTION_NODE_MAINTENANCE,
DESCRIPTION_NVIDIA_GPU,
DESCRIPTION_ODF,
Expand Down Expand Up @@ -297,6 +303,36 @@ export const getOperatorSpecs = (
supportLevel: getFeatureSupportLevel('SERVICEMESH'),
},
],
[categories[Category.REMEDIATION]]: [
{
operatorKey: OPERATOR_NAME_NODE_HEALTHCHECK,
title: 'Node Healthcheck',
featureId: 'NODE_HEALTHCHECK',
descriptionText: DESCRIPTION_NODE_HEALTHCHECK,
Description: ({ searchTerm }) => (
<>
<HighlightedText text={DESCRIPTION_NODE_HEALTHCHECK} searchTerm={searchTerm} />{' '}
<ExternalLink href={NODE_HEALTHCHECK_LINK}>Learn more</ExternalLink>
</>
),
notStandalone: true,
supportLevel: getFeatureSupportLevel('NODE_HEALTHCHECK'),
},
{
operatorKey: OPERATOR_NAME_FENCE_AGENTS_REMEDIATION,
title: 'Fence Agents Remediation',
featureId: 'FENCE_AGENTS_REMEDIATION',
descriptionText: DESCRIPTION_FENCE_AGENTS_REMEDIATION,
Description: ({ searchTerm }) => (
<>
<HighlightedText text={DESCRIPTION_FENCE_AGENTS_REMEDIATION} searchTerm={searchTerm} />{' '}
<ExternalLink href={FENCE_AGENTS_REMEDIATION_LINK}>Learn more</ExternalLink>
</>
),
notStandalone: true,
supportLevel: getFeatureSupportLevel('FENCE_AGENTS_REMEDIATION'),
},
],
[categories[Category.SECURITY]]: [
{
operatorKey: OPERATOR_NAME_AUTHORINO,
Expand Down Expand Up @@ -464,6 +500,8 @@ enum Category {
PLATFORM,
SECURITY,
SCHEDULING,
REMEDIATION,
OTHER,
}

export const categories: { [key in Category]: string } = {
Expand All @@ -475,4 +513,6 @@ export const categories: { [key in Category]: string } = {
[Category.CI_CD]: 'CI/CD & Dev Productivity',
[Category.PLATFORM]: 'Platform Operations & Lifecycle',
[Category.SCHEDULING]: 'Scheduling',
[Category.REMEDIATION]: 'Remediation',
[Category.OTHER]: 'Other',
};
20 changes: 2 additions & 18 deletions libs/ui-lib/lib/ocm/services/OperatorsService.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
import OperatorsAPI from '../../common/api/assisted-service/OperatorsAPI';
import { getOperatorSpecs } from '../../common/components/operators/operatorSpecs';

const getAllKnownOperatorKeys = (): Set<string> => {
const allSpecsByCategory = getOperatorSpecs(() => undefined);

const allKeys = Object.values(allSpecsByCategory)
.flat()
.map((spec) => spec.operatorKey);

return new Set(allKeys);
};

const OperatorsService = {
getSupportedOperators: async (): Promise<string[]> => {
const knownOperatorKeys = getAllKnownOperatorKeys();
const { data: operatorsFromAPI } = await OperatorsAPI.list();
const filteredOperators = operatorsFromAPI.filter((operatorName) =>
knownOperatorKeys.has(operatorName),
);

return filteredOperators;
const { data: operators } = await OperatorsAPI.list();
return operators;
},
};
export default OperatorsService;
Loading