@@ -120,7 +120,7 @@ const processKubeCTLApply = (
120
120
timelineData : DeploymentStatusBreakdownItemType ,
121
121
element : DeploymentStatusDetailsTimelineType ,
122
122
deploymentStatus : DeploymentStatusDetailsBreakdownDataType [ 'deploymentStatus' ] ,
123
- data ? : DeploymentStatusDetailsType ,
123
+ data : DeploymentStatusDetailsType ,
124
124
) => {
125
125
const tableData : {
126
126
currentPhase : DeploymentPhaseType | ''
@@ -131,22 +131,27 @@ const processKubeCTLApply = (
131
131
}
132
132
133
133
// Resource details are present in KUBECTL_APPLY_STARTED timeline alone
134
- const resourceDetails = data ? .timelines ? .find (
134
+ const resourceDetails = data . timelines . find (
135
135
( item ) => item . status === TIMELINE_STATUS . KUBECTL_APPLY_STARTED ,
136
136
) ?. resourceDetails
137
137
138
138
if ( resourceDetails ) {
139
- // TODO: Confirm this logic since, can have duplication of resourcePhase in the resourceDetails
140
139
// Used to parse resource details base struct with current phase as last phase
141
140
DEPLOYMENT_PHASES . forEach ( ( phase ) => {
141
+ let breakPhase = false
142
142
resourceDetails . forEach ( ( item ) => {
143
+ if ( breakPhase ) {
144
+ return
145
+ }
146
+
143
147
if ( phase === item . resourcePhase ) {
144
148
tableData . currentPhase = phase
145
149
tableData . currentTableData . push ( {
146
150
icon : 'success' ,
147
151
phase,
148
152
message : `${ phase } : Create and update resources based on manifest` ,
149
153
} )
154
+ breakPhase = true
150
155
}
151
156
} )
152
157
} )
0 commit comments