diff --git a/frontend/packages/operator-lifecycle-manager/src/dev-catalog.ts b/frontend/packages/operator-lifecycle-manager/src/dev-catalog.ts index e13c1ac035c..3a41173e707 100644 --- a/frontend/packages/operator-lifecycle-manager/src/dev-catalog.ts +++ b/frontend/packages/operator-lifecycle-manager/src/dev-catalog.ts @@ -4,6 +4,21 @@ import { ClusterServiceVersionKind } from './types'; import { referenceForProvidedAPI, providedAPIsFor } from './components'; import * as operatorLogo from './operator.svg'; +const isInternal = (crd: { name: string }): boolean => { + const internalOpListString = _.get( + crd, + ['csv', 'metadata', 'annotations', 'operators.operatorframework.io/internal-objects'], + '[]', + ); + try { + const internalOpList = JSON.parse(internalOpListString); // JSON.parse fails if incorrect annotation structure + return internalOpList.some((op) => op === crd.name); + } catch { + /* eslint-disable-next-line no-console */ + console.error('Failed to parse CSV annotation: Invalid JSON structure'); + return false; + } +}; export const normalizeClusterServiceVersions = ( clusterServiceVersions: ClusterServiceVersionKind[], ): K8sResourceKind[] => { @@ -24,6 +39,8 @@ export const normalizeClusterServiceVersions = ( : all.concat([cur]), [], ) + // remove internal CRDs + .filter((crd) => !isInternal(crd)) .map((desc) => ({ // NOTE: Faking a real k8s object to avoid fetching all CRDs obj: { diff --git a/frontend/public/components/catalog/catalog-page.tsx b/frontend/public/components/catalog/catalog-page.tsx index a4bf0101e97..8206787804c 100644 --- a/frontend/public/components/catalog/catalog-page.tsx +++ b/frontend/public/components/catalog/catalog-page.tsx @@ -114,15 +114,7 @@ export class CatalogListPage extends React.Component