Skip to content

Commit 5c94e47

Browse files
author
Nishant Burte
committed
Fix flowlog crash
While creating FlowLog, if logDestnation does not exist then CreateFlowLogsWithContext does not return the error. However, Unsuccessful field in the response is set. FlowLog is not created in aws. Due to this, controller crashes while accessing the flow log id from the response (resp.FlowLogIds[0]). Fixing the issue by checking if FlowLogIds has valid length before accessing it.
1 parent dc920e9 commit 5c94e47

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ack_generate_info:
2-
build_date: "2023-09-18T23:03:44Z"
2+
build_date: "2023-10-26T21:49:39Z"
33
build_hash: 892f29d00a4c4ad21a2fa32919921de18190979d
4-
go_version: go1.20.3
4+
go_version: go1.21.1
55
version: v0.27.1
66
api_directory_checksum: 6e2d850d97f2f72db31c9bef522eca4ab95b3fcd
77
api_version: v1alpha1

pkg/resource/flow_log/sdk.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
if resp.FlowLogIds[0] != nil {
1+
if len(resp.FlowLogIds) > 0 && resp.FlowLogIds[0] != nil {
22
ko.Status.FlowLogID = resp.FlowLogIds[0]
33
}

0 commit comments

Comments
 (0)