diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index e234470a..7ce88e4f 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,8 +1,8 @@ ack_generate_info: - build_date: "2024-01-03T22:47:06Z" - build_hash: 00e081fb541587f33970ad80c99f2ac02e9c2525 + build_date: "2024-01-15T16:33:37Z" + build_hash: 3753ca3f6610172e9e652d6e5e62e0a05f2e639c go_version: go1.21.5 - version: v0.28.0-8-g00e081f + version: v0.28.0-11-g3753ca3 api_directory_checksum: 8b27f9e65dbad1f5f825c84d1dbe8fd333baf2a5 api_version: v1alpha1 aws_sdk_go_version: v1.44.93 diff --git a/pkg/resource/security_group/sdk.go b/pkg/resource/security_group/sdk.go index bd8b10c3..c19458cb 100644 --- a/pkg/resource/security_group/sdk.go +++ b/pkg/resource/security_group/sdk.go @@ -123,6 +123,10 @@ func (rm *resourceManager) sdkFind( rm.setStatusDefaults(ko) if found { + + // Needed because SecurityGroups Name are held in GroupName property of the AWS resource + ko.Spec.Name = resp.SecurityGroups[0].GroupName + rm.addRulesToSpec(ko, resp.SecurityGroups[0]) // A ReadOne call for SecurityGroup Rules (NOT SecurityGroups) @@ -133,6 +137,7 @@ func (rm *resourceManager) sdkFind( ko.Status.Rules = rules } } + return &resource{ko}, nil } diff --git a/templates/hooks/security_group/sdk_read_many_post_set_output.go.tpl b/templates/hooks/security_group/sdk_read_many_post_set_output.go.tpl index b232fccd..b53a34af 100644 --- a/templates/hooks/security_group/sdk_read_many_post_set_output.go.tpl +++ b/templates/hooks/security_group/sdk_read_many_post_set_output.go.tpl @@ -1,4 +1,8 @@ if found { + + // Needed because SecurityGroups Name are held in GroupName property of the AWS resource + ko.Spec.Name = resp.SecurityGroups[0].GroupName + rm.addRulesToSpec(ko, resp.SecurityGroups[0]) // A ReadOne call for SecurityGroup Rules (NOT SecurityGroups) @@ -8,4 +12,4 @@ } else { ko.Status.Rules = rules } - } \ No newline at end of file + }