File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,20 +116,33 @@ export function getiNodesByRootNodeWithChildNodes(
116116 } )
117117 } )
118118
119- // Add containers to Pod type nodes
119+ // Add init containers and containers to Pod type nodes
120120 children
121121 . filter ( ( _child ) => _child . kind . toLowerCase ( ) == Nodes . Pod . toLowerCase ( ) )
122122 . map ( ( _pn ) => {
123+ const podMeta = ( podMetadata || _appDetailsSubject . getValue ( ) . resourceTree ?. podMetadata ) ?. filter (
124+ ( _pmd ) => _pmd . uid === _pn . uid ,
125+ ) [ 0 ]
126+
127+ const initNodes : iNode [ ] = ( podMeta ?. initContainers || [ ] ) . map ( ( _c : string ) => {
128+ const initNode = { } as iNode
129+ initNode . kind = Nodes . Containers
130+ initNode . name = _c
131+ initNode . pNode = _pn
132+ initNode . isInitContainer = true
133+ return initNode
134+ } )
135+
136+ const containerNodes : iNode [ ] = ( podMeta ?. containers || [ ] ) . map ( ( _c : string ) => {
137+ const childNode = { } as iNode
138+ childNode . kind = Nodes . Containers
139+ childNode . name = _c
140+ childNode . pNode = _pn
141+ return childNode
142+ } )
143+
123144 // eslint-disable-next-line no-param-reassign
124- _pn . childNodes = ( podMetadata || _appDetailsSubject . getValue ( ) . resourceTree ?. podMetadata )
125- ?. filter ( ( _pmd ) => _pmd . uid === _pn . uid ) [ 0 ]
126- ?. containers ?. map ( ( _c ) => {
127- const childNode = { } as iNode
128- childNode . kind = Nodes . Containers
129- childNode . pNode = _pn
130- childNode . name = _c
131- return childNode
132- } )
145+ _pn . childNodes = [ ...initNodes , ...containerNodes ]
133146 } )
134147 children = children . flatMap ( ( _node ) => _node . childNodes ?? [ ] )
135148 }
Original file line number Diff line number Diff line change @@ -174,6 +174,8 @@ export interface iNode extends Node {
174174 type : NodeType
175175 status : string
176176 pNode ?: iNode
177+ /** Marks a node as an init container, used for display purposes in the resource tree. */
178+ isInitContainer ?: boolean
177179}
178180
179181export interface HelmReleaseStatus {
You can’t perform that action at this time.
0 commit comments