mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-16 19:52:49 -06:00
Make composite literals to use keyed fields
This will prevent following error: - * composite literal uses unkeyed fields
This commit is contained in:
parent
db729e5571
commit
e149a97658
@ -336,7 +336,7 @@ func resourceAwsAutoscalingGroupDrain(d *schema.ResourceData, meta interface{})
|
||||
return resource.Retry(10*time.Minute, func() error {
|
||||
g, err := getAwsAutoscalingGroup(d, meta)
|
||||
if err != nil {
|
||||
return resource.RetryError{err}
|
||||
return resource.RetryError{Err: err}
|
||||
}
|
||||
if g == nil {
|
||||
return nil
|
||||
|
@ -42,7 +42,8 @@ func testAccCheckDBSubnetGroupDestroy(s *terraform.State) error {
|
||||
}
|
||||
|
||||
// Try to find the resource
|
||||
resp, err := conn.DescribeDBSubnetGroups(&rds.DescribeDBSubnetGroups{rs.Primary.ID})
|
||||
resp, err := conn.DescribeDBSubnetGroups(
|
||||
&rds.DescribeDBSubnetGroups{DBSubnetGroupName: rs.Primary.ID})
|
||||
if err == nil {
|
||||
if len(resp.DBSubnetGroups) > 0 {
|
||||
return fmt.Errorf("still exist.")
|
||||
@ -76,7 +77,8 @@ func testAccCheckDBSubnetGroupExists(n string, v *rds.DBSubnetGroup) resource.Te
|
||||
}
|
||||
|
||||
conn := testAccProvider.Meta().(*AWSClient).rdsconn
|
||||
resp, err := conn.DescribeDBSubnetGroups(&rds.DescribeDBSubnetGroups{rs.Primary.ID})
|
||||
resp, err := conn.DescribeDBSubnetGroups(
|
||||
&rds.DescribeDBSubnetGroups{DBSubnetGroupName: rs.Primary.ID})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ func resourceAwsEipDelete(d *schema.ResourceData, meta interface{}) error {
|
||||
return nil
|
||||
}
|
||||
if _, ok := err.(*ec2.Error); !ok {
|
||||
return resource.RetryError{err}
|
||||
return resource.RetryError{Err: err}
|
||||
}
|
||||
|
||||
return err
|
||||
|
@ -124,7 +124,7 @@ func resourceAwsInternetGatewayDelete(d *schema.ResourceData, meta interface{})
|
||||
return err // retry
|
||||
}
|
||||
|
||||
return resource.RetryError{err}
|
||||
return resource.RetryError{Err: err}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -268,10 +268,10 @@ func resourceAwsNetworkAclDelete(d *schema.ResourceData, meta interface{}) error
|
||||
return fmt.Errorf("Dependency violation: Cannot delete acl %s: %s", d.Id(), err)
|
||||
}
|
||||
_, err = ec2conn.ReplaceNetworkAclAssociation(association.NetworkAclAssociationId, defaultAcl.NetworkAclId)
|
||||
return resource.RetryError{err}
|
||||
return resource.RetryError{Err: err}
|
||||
default:
|
||||
// Any other error, we want to quit the retry loop immediately
|
||||
return resource.RetryError{err}
|
||||
return resource.RetryError{Err: err}
|
||||
}
|
||||
}
|
||||
log.Printf("[Info] Deleted network ACL %s successfully", d.Id())
|
||||
|
@ -380,7 +380,7 @@ func resourceAwsSecurityGroupDelete(d *schema.ResourceData, meta interface{}) er
|
||||
return err
|
||||
default:
|
||||
// Any other error, we want to quit the retry loop immediately
|
||||
return resource.RetryError{err}
|
||||
return resource.RetryError{Err: err}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user