Skip to content

Commit

Permalink
Removing all the internal API Cards from Overview page
Browse files Browse the repository at this point in the history
A minimal change to remove all the internal API cards from 'Installed
Operator' -> Overview page

Signed-off-by: Arun Kumar Mohan <arun.iiird@gmail.com>
  • Loading branch information
aruniiird committed Jan 4, 2020
1 parent 9ef3ee3 commit d920f88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import {
SubscriptionKind,
SubscriptionState,
} from '../types';
import { isInternal } from '../dev-catalog';
import { ProvidedAPIsPage, ProvidedAPIPage } from './operand';
import { createUninstallOperatorModal } from './modals/uninstall-operator-modal';
import { operatorGroupFor, operatorNamespaceFor } from './operator-group';
Expand Down Expand Up @@ -570,6 +571,9 @@ export const CRDCard: React.SFC<CRDCardProps> = (props) => {
`/k8s/ns/${csv.metadata.namespace}/${ClusterServiceVersionModel.plural}/${
csv.metadata.name
}/${reference}/~new`;
if (crd.displayName.startsWith("[Internal]")) {
return null
}
return (
<Card>
<CardHeader>
Expand Down Expand Up @@ -616,7 +620,7 @@ export const CRDCardRow = connect(crdCardRowStateToProps)((props: CRDCardRowProp
{_.isEmpty(props.crdDescs) ? (
<span className="text-muted">No Kubernetes APIs are being provided by this Operator.</span>
) : (
props.crdDescs.map((desc) => (
props.crdDescs.filter((crd) => !isInternal(crd)).map((desc) => (
<CRDCard
key={referenceForProvidedAPI(desc)}
crd={desc}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ClusterServiceVersionKind } from './types';
import { referenceForProvidedAPI, providedAPIsFor } from './components';
import * as operatorLogo from './operator.svg';

const isInternal = (crd: { name: string }): boolean => {
export const isInternal = (crd: { name: string }): boolean => {
const internalOpListString = _.get(
crd,
['csv', 'metadata', 'annotations', 'operators.operatorframework.io/internal-objects'],
Expand All @@ -19,6 +19,7 @@ const isInternal = (crd: { name: string }): boolean => {
return false;
}
};

export const normalizeClusterServiceVersions = (
clusterServiceVersions: ClusterServiceVersionKind[],
): K8sResourceKind[] => {
Expand Down

0 comments on commit d920f88

Please sign in to comment.