Skip to content

Commit 1f46a83

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 1f46a83

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ack_generate_info:
2-
build_date: "2023-09-18T23:03:44Z"
3-
build_hash: 892f29d00a4c4ad21a2fa32919921de18190979d
4-
go_version: go1.20.3
5-
version: v0.27.1
2+
build_date: "2023-10-26T21:28:28Z"
3+
build_hash: ca2060387b6ffb66a3c231929cc1243ab5d5f905
4+
go_version: go1.21.1
5+
version: v0.27.1-3-gca20603
66
api_directory_checksum: 6e2d850d97f2f72db31c9bef522eca4ab95b3fcd
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93

config/controller/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ kind: Kustomization
66
images:
77
- name: controller
88
newName: public.ecr.aws/aws-controllers-k8s/ec2-controller
9-
newTag: 1.0.7
9+
newTag: 1.0.8

helm/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
22
name: ec2-chart
33
description: A Helm chart for the ACK service controller for Amazon Elastic Cloud Compute (EC2)
4-
version: 1.0.7
5-
appVersion: 1.0.7
4+
version: 1.0.8
5+
appVersion: 1.0.8
66
home: https://github.com/aws-controllers-k8s/ec2-controller
77
icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png
88
sources:

helm/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ .Chart.Name }} has been installed.
2-
This chart deploys "public.ecr.aws/aws-controllers-k8s/ec2-controller:1.0.7".
2+
This chart deploys "public.ecr.aws/aws-controllers-k8s/ec2-controller:1.0.8".
33

44
Check its status by running:
55
kubectl --namespace {{ .Release.Namespace }} get pods -l "app.kubernetes.io/instance={{ .Release.Name }}"

helm/templates/deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ spec:
123123
readOnly: true
124124
{{- end }}
125125
{{- if .Values.deployment.extraVolumeMounts -}}
126-
{{ toYaml .Values.deployment.extraVolumeMounts | nindent 12 }}
126+
{{ toYaml .Values.deployment.extraVolumeMounts | nindent 10 }}
127127
{{- end }}
128128
securityContext:
129129
allowPrivilegeEscalation: false
@@ -151,11 +151,11 @@ spec:
151151
hostNetwork: {{ .Values.deployment.hostNetwork }}
152152
dnsPolicy: {{ .Values.deployment.dnsPolicy }}
153153
volumes:
154-
{{- if .Values.aws.credentials.secretName -}}
154+
{{- if .Values.aws.credentials.secretName }}
155155
- name: {{ .Values.aws.credentials.secretName }}
156156
secret:
157157
secretName: {{ .Values.aws.credentials.secretName }}
158-
{{ end -}}
158+
{{- end }}
159159
{{- if .Values.deployment.extraVolumes }}
160160
{{ toYaml .Values.deployment.extraVolumes | indent 8}}
161161
{{- end }}

helm/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
image:
66
repository: public.ecr.aws/aws-controllers-k8s/ec2-controller
7-
tag: 1.0.7
7+
tag: 1.0.8
88
pullPolicy: IfNotPresent
99
pullSecrets: []
1010

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)