diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index c5523f1d..a51426c6 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-12-06T21:43:43Z" - build_hash: 892f29d00a4c4ad21a2fa32919921de18190979d + build_date: "2023-12-13T07:19:26Z" + build_hash: 3653329ceeb20015851b8776a6061a3fb0ec2935 go_version: go1.21.1 - version: v0.27.1 -api_directory_checksum: 6e2d850d97f2f72db31c9bef522eca4ab95b3fcd + version: v0.27.1-6-g3653329 +api_directory_checksum: d452bf19bfd1496aacdc215bf7cc9ea86c55c122 api_version: v1alpha1 aws_sdk_go_version: v1.44.93 generator_config_info: - file_checksum: d10a62517f87bacf988184f8c454b90b42dee732 + file_checksum: ff084526a7037be1c7d08e2c7e742ac0679abc5f original_file_name: generator.yaml last_modification: reason: API generation diff --git a/apis/v1alpha1/generator.yaml b/apis/v1alpha1/generator.yaml index 0c64bb77..5ea7d432 100644 --- a/apis/v1alpha1/generator.yaml +++ b/apis/v1alpha1/generator.yaml @@ -549,6 +549,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 0c64bb77..5ea7d432 100644 --- a/generator.yaml +++ b/generator.yaml @@ -549,6 +549,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/pkg/resource/security_group/resource.go b/pkg/resource/security_group/resource.go index 2a366df4..2073c0fb 100644 --- a/pkg/resource/security_group/resource.go +++ b/pkg/resource/security_group/resource.go @@ -90,6 +90,10 @@ func (r *resource) SetIdentifiers(identifier *ackv1alpha1.AWSIdentifiers) error } r.ko.Status.ID = &identifier.NameOrID + if name, ok := identifier.AdditionalKeys["name"]; ok { + r.ko.Spec.Name = &name + } + return nil } 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..a8713f2a --- /dev/null +++ b/templates/hooks/security_group/post_set_resource_identifiers.go.tpl @@ -0,0 +1,3 @@ + if name, ok := identifier.AdditionalKeys["name"]; ok { + r.ko.Spec.Name = &name + }