@@ -181,6 +181,7 @@ func getCommentSummary(ctx context.Context, planFilePath string) (statusIcon, su
181
181
destroy := TfChange {actionName : "Destroy" , changes : make (map [string ]int ), actionCount : 0 }
182
182
update := TfChange {actionName : "Update" , changes : make (map [string ]int ), actionCount : 0 }
183
183
replace := TfChange {actionName : "Replace" , changes : make (map [string ]int ), actionCount : 0 }
184
+ forget := TfChange {actionName : "Forget" , changes : make (map [string ]int ), actionCount : 0 }
184
185
for _ , res := range jsonPlan .ResourceChanges {
185
186
actions := res .Change .Actions
186
187
resourceType := res .Type
@@ -193,13 +194,17 @@ func getCommentSummary(ctx context.Context, planFilePath string) (statusIcon, su
193
194
update .add (resourceType )
194
195
case actions .Replace ():
195
196
replace .add (resourceType )
197
+ case actions .Forget ():
198
+ forget .add (resourceType )
196
199
case
197
200
actions .NoOp (),
198
201
actions .Read ():
199
202
// Do nothing
200
203
continue
201
204
default :
202
- sg .Logger (ctx ).Fatal (fmt .Errorf ("unable to determine resource operation: %v" , res ))
205
+ sg .Logger (ctx ).Fatal (
206
+ fmt .Errorf ("unable to build a terraform plan summary due to unknown actions (%v) on resource: %v" , actions , res ),
207
+ )
203
208
}
204
209
}
205
210
@@ -212,14 +217,15 @@ func getCommentSummary(ctx context.Context, planFilePath string) (statusIcon, su
212
217
}
213
218
214
219
summary = fmt .Sprintf (`
215
- Plan Summary: %d to create, %d to update, %d to replace, %d to destroy.
220
+ Plan Summary: %d to create, %d to update, %d to replace, %d to destroy, %d to forget .
216
221
<br/>
217
222
%s
218
223
` ,
219
224
create .actionCount ,
220
225
update .actionCount ,
221
226
replace .actionCount ,
222
227
destroy .actionCount ,
228
+ forget .actionCount ,
223
229
mapToHTMLList ([]TfChange {create , destroy , update , replace }),
224
230
)
225
231
0 commit comments