diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index ae0c8170..44630b5d 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,13 +1,13 @@ ack_generate_info: - build_date: "2023-09-18T23:03:44Z" - build_hash: 892f29d00a4c4ad21a2fa32919921de18190979d - go_version: go1.20.3 - version: v0.27.1 + build_date: "2023-12-05T16:46:52Z" + build_hash: 3653329ceeb20015851b8776a6061a3fb0ec2935 + go_version: go1.21.4 + version: v0.27.1-6-g3653329-dirty api_directory_checksum: 6e2d850d97f2f72db31c9bef522eca4ab95b3fcd api_version: v1alpha1 aws_sdk_go_version: v1.44.93 generator_config_info: - file_checksum: c474e6cdec9622afad4b4cef415483a7bd0eda41 + file_checksum: e900e7783872dcd15c10fd4efb10d069047e3db4 original_file_name: generator.yaml last_modification: reason: API generation diff --git a/apis/v1alpha1/generator.yaml b/apis/v1alpha1/generator.yaml index 245abe3c..4771667f 100644 --- a/apis/v1alpha1/generator.yaml +++ b/apis/v1alpha1/generator.yaml @@ -334,6 +334,8 @@ resources: template_path: hooks/flow_log/sdk_read_many_post_build_request.go.tpl sdk_file_end: template_path: hooks/flow_log/sdk_file_end.go.tpl + post_set_resource_identifiers: + template_path: hooks/flow_log/post_set_resource_identifiers.go.tpl update_operation: custom_method_name: customUpdateFlowLog InternetGateway: @@ -537,6 +539,8 @@ resources: template_path: hooks/security_group/sdk_create_post_set_output.go.tpl sdk_read_many_post_set_output: template_path: hooks/security_group/sdk_read_many_post_set_output.go.tpl + post_set_resource_identifiers: + template_path: hooks/security_group/post_set_resource_identifiers.go.tpl update_operation: custom_method_name: customUpdateSecurityGroup NetworkAcl: diff --git a/generator.yaml b/generator.yaml index 245abe3c..4771667f 100644 --- a/generator.yaml +++ b/generator.yaml @@ -334,6 +334,8 @@ resources: template_path: hooks/flow_log/sdk_read_many_post_build_request.go.tpl sdk_file_end: template_path: hooks/flow_log/sdk_file_end.go.tpl + post_set_resource_identifiers: + template_path: hooks/flow_log/post_set_resource_identifiers.go.tpl update_operation: custom_method_name: customUpdateFlowLog InternetGateway: @@ -537,6 +539,8 @@ resources: template_path: hooks/security_group/sdk_create_post_set_output.go.tpl sdk_read_many_post_set_output: template_path: hooks/security_group/sdk_read_many_post_set_output.go.tpl + post_set_resource_identifiers: + template_path: hooks/security_group/post_set_resource_identifiers.go.tpl update_operation: custom_method_name: customUpdateSecurityGroup NetworkAcl: diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index f40b5f22..cea38ec9 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -123,7 +123,7 @@ spec: readOnly: true {{- end }} {{- if .Values.deployment.extraVolumeMounts -}} - {{ toYaml .Values.deployment.extraVolumeMounts | nindent 12 }} + {{ toYaml .Values.deployment.extraVolumeMounts | nindent 10 }} {{- end }} securityContext: allowPrivilegeEscalation: false @@ -151,11 +151,11 @@ spec: hostNetwork: {{ .Values.deployment.hostNetwork }} dnsPolicy: {{ .Values.deployment.dnsPolicy }} volumes: - {{- if .Values.aws.credentials.secretName -}} + {{- if .Values.aws.credentials.secretName }} - name: {{ .Values.aws.credentials.secretName }} secret: secretName: {{ .Values.aws.credentials.secretName }} - {{ end -}} + {{- end }} {{- if .Values.deployment.extraVolumes }} {{ toYaml .Values.deployment.extraVolumes | indent 8}} {{- end }} diff --git a/pkg/resource/flow_log/resource.go b/pkg/resource/flow_log/resource.go index 990204aa..b5ead968 100644 --- a/pkg/resource/flow_log/resource.go +++ b/pkg/resource/flow_log/resource.go @@ -90,6 +90,15 @@ func (r *resource) SetIdentifiers(identifier *ackv1alpha1.AWSIdentifiers) error } r.ko.Status.FlowLogID = &identifier.NameOrID + identifierResourceID, identifierResourceIDOk := identifier.AdditionalKeys["resourceID"] + if identifierResourceIDOk { + r.ko.Spec.ResourceID = &identifierResourceID + } + identifierResourceType, identifierResourceTypeOk := identifier.AdditionalKeys["resourceType"] + if identifierResourceTypeOk { + r.ko.Spec.ResourceType = &identifierResourceType + } + return nil } diff --git a/pkg/resource/security_group/resource.go b/pkg/resource/security_group/resource.go index 2a366df4..d564ea81 100644 --- a/pkg/resource/security_group/resource.go +++ b/pkg/resource/security_group/resource.go @@ -90,6 +90,11 @@ func (r *resource) SetIdentifiers(identifier *ackv1alpha1.AWSIdentifiers) error } r.ko.Status.ID = &identifier.NameOrID + identifierName, identifierNameOk := identifier.AdditionalKeys["name"] + if identifierNameOk { + r.ko.Spec.Name = &identifierName + } + return nil } diff --git a/templates/hooks/flow_log/post_set_resource_identifiers.go.tpl b/templates/hooks/flow_log/post_set_resource_identifiers.go.tpl new file mode 100644 index 00000000..2e33c9af --- /dev/null +++ b/templates/hooks/flow_log/post_set_resource_identifiers.go.tpl @@ -0,0 +1,8 @@ + identifierResourceID, identifierResourceIDOk := identifier.AdditionalKeys["resourceID"] + if identifierResourceIDOk { + r.ko.Spec.ResourceID = &identifierResourceID + } + identifierResourceType, identifierResourceTypeOk := identifier.AdditionalKeys["resourceType"] + if identifierResourceTypeOk { + r.ko.Spec.ResourceType = &identifierResourceType + } diff --git a/templates/hooks/security_group/post_set_resource_identifiers.go.tpl b/templates/hooks/security_group/post_set_resource_identifiers.go.tpl new file mode 100644 index 00000000..beb6c05f --- /dev/null +++ b/templates/hooks/security_group/post_set_resource_identifiers.go.tpl @@ -0,0 +1,4 @@ + identifierName, identifierNameOk := identifier.AdditionalKeys["name"] + if identifierNameOk { + r.ko.Spec.Name = &identifierName + }