import clsx from 'clsx'; import { Fragment } from 'react'; import { nodeAffinityValues } from '@/kubernetes/filters/application'; import { useAuthorizations } from '@/react/hooks/useUser'; import { Affinity, Label, Node, Taint } from '../types'; interface SubRowProps { node: Node; cellCount: number; } export function SubRow({ node, cellCount }: SubRowProps) { const authorized = useAuthorizations( 'K8sApplicationErrorDetailsR', undefined, true ); if (!authorized) { <> {isDefined(node.UnmetTaints) && ( Placement constraint not respected for that node. )} {(isDefined(node.UnmatchedNodeSelectorLabels) || isDefined(node.UnmatchedNodeAffinities)) && ( Placement label not respected for that node. )} ; } return ( <> {isDefined(node.UnmetTaints) && ( )} {isDefined(node.UnmatchedNodeSelectorLabels) && ( )} {isDefined(node.UnmatchedNodeAffinities) && ( )} ); } function isDefined(arr?: Array): arr is Array { return !!arr && arr.length > 0; } function UnmetTaintsInfo({ taints, isHighlighted, cellCount, }: { taints: Array; isHighlighted: boolean; cellCount: number; }) { return ( <> {taints.map((taint) => ( This application is missing a toleration for the taint {taint.Key} {taint.Value ? `=${taint.Value}` : ''}:{taint.Effect} ))} ); } function UnmatchedLabelsInfo({ labels, isHighlighted, cellCount, }: { labels: Array