File tree 3 files changed +10
-5
lines changed
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { HoverInfoLabel } from '../common';
5
5
import ResourceListView from '../common/Resource/ResourceListView' ;
6
6
import { UsageBarChart } from './Charts' ;
7
7
import { NodeReadyLabel } from './Details' ;
8
- import { NodeTaintsLabel } from './utils' ;
8
+ import { formatTaint , NodeTaintsLabel } from './utils' ;
9
9
10
10
export default function NodeList ( ) {
11
11
const [ nodeMetrics , metricsError ] = Node . useMetrics ( ) ;
@@ -70,8 +70,7 @@ export default function NodeList() {
70
70
{
71
71
id : 'taints' ,
72
72
label : t ( 'translation|Taints' ) ,
73
- getValue : node =>
74
- node . spec ?. taints ?. map ( taint => `${ taint . key } :${ taint . effect } ` ) ?. join ( ', ' ) ,
73
+ getValue : node => node . spec ?. taints ?. map ( taint => formatTaint ( taint ) ) ?. join ( ', ' ) ,
75
74
render : ( item : Node ) => < NodeTaintsLabel node = { item } /> ,
76
75
} ,
77
76
{
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ const PaddedChip = styled(Chip)({
18
18
paddingBottom : '2px' ,
19
19
} ) ;
20
20
21
+ export function formatTaint ( taint : { key : string ; value ?: string ; effect : string } ) {
22
+ return `${ taint . key } ${ taint . value ? '=' + taint . value : '' } :${ taint . effect } ` ;
23
+ }
24
+
21
25
export function NodeTaintsLabel ( props : { node : Node } ) {
22
26
const { node } = props ;
23
27
const { t } = useTranslation ( [ 'glossary' , 'translation' ] ) ;
@@ -26,9 +30,10 @@ export function NodeTaintsLabel(props: { node: Node }) {
26
30
}
27
31
const limits : ReactNode [ ] = [ ] ;
28
32
node . spec . taints . forEach ( taint => {
33
+ const format = formatTaint ( taint ) ;
29
34
limits . push (
30
- < Tooltip title = { ` ${ taint . key } : ${ taint . effect } ` } key = { taint . key } >
31
- < PaddedChip label = { ` ${ taint . key } : ${ taint . effect } ` } variant = "outlined" size = "small" />
35
+ < Tooltip title = { format } key = { taint . key } >
36
+ < PaddedChip label = { format } variant = "outlined" size = "small" />
32
37
</ Tooltip >
33
38
) ;
34
39
} ) ;
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ export interface KubeNode extends KubeObjectInterface {
47
47
podCIDR : string ;
48
48
taints : {
49
49
key : string ;
50
+ value ?: string ;
50
51
effect : string ;
51
52
} [ ] ;
52
53
[ otherProps : string ] : any ;
You can’t perform that action at this time.
0 commit comments