refactor(remote): remove useless details fetcher

For aws_ebs_encryption_by_default resource type.
main
sundowndev-snyk 2022-03-31 15:59:20 +04:00
parent b08c6d55ef
commit 314a693dba
No known key found for this signature in database
GPG Key ID: A4A2BE47AC4C6A68
2 changed files with 5 additions and 6 deletions

View File

@ -21,8 +21,8 @@ func TestAwsEbsEncryptionByDefaultReconciler_Execute(t *testing.T) {
expected []*resource.Resource
}{
{
"test encryption by default is managed",
func(factory *terraform.MockResourceFactory) {
name: "test encryption by default is managed",
mocks: func(factory *terraform.MockResourceFactory) {
factory.On("CreateAbstractResource",
aws.AwsEbsEncryptionByDefaultResourceType,
"terraform-20220328091515068500000001",
@ -38,7 +38,7 @@ func TestAwsEbsEncryptionByDefaultReconciler_Execute(t *testing.T) {
},
}).Once()
},
[]*resource.Resource{
remoteResources: []*resource.Resource{
{
Id: "bucket-1",
Type: aws.AwsS3BucketResourceType,
@ -52,7 +52,7 @@ func TestAwsEbsEncryptionByDefaultReconciler_Execute(t *testing.T) {
},
},
},
[]*resource.Resource{
resourcesFromState: []*resource.Resource{
{
Id: "bucket-1",
Type: aws.AwsS3BucketResourceType,
@ -67,7 +67,7 @@ func TestAwsEbsEncryptionByDefaultReconciler_Execute(t *testing.T) {
},
},
},
[]*resource.Resource{
expected: []*resource.Resource{
{
Id: "bucket-1",
Type: aws.AwsS3BucketResourceType,

View File

@ -118,7 +118,6 @@ func Init(version string, alerter *alerter.Alerter,
remoteLibrary.AddDetailsFetcher(aws.AwsSecurityGroupRuleResourceType, common.NewGenericDetailsFetcher(aws.AwsSecurityGroupRuleResourceType, provider, deserializer))
remoteLibrary.AddEnumerator(NewLaunchTemplateEnumerator(ec2repository, factory))
remoteLibrary.AddEnumerator(NewEC2EbsEncryptionByDefaultEnumerator(ec2repository, factory))
remoteLibrary.AddDetailsFetcher(aws.AwsEbsEncryptionByDefaultResourceType, common.NewGenericDetailsFetcher(aws.AwsEbsEncryptionByDefaultResourceType, provider, deserializer))
remoteLibrary.AddEnumerator(NewKMSKeyEnumerator(kmsRepository, factory))
remoteLibrary.AddDetailsFetcher(aws.AwsKmsKeyResourceType, common.NewGenericDetailsFetcher(aws.AwsKmsKeyResourceType, provider, deserializer))