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 {
|
return resource.Retry(10*time.Minute, func() error {
|
||||||
g, err := getAwsAutoscalingGroup(d, meta)
|
g, err := getAwsAutoscalingGroup(d, meta)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return resource.RetryError{err}
|
return resource.RetryError{Err: err}
|
||||||
}
|
}
|
||||||
if g == nil {
|
if g == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -42,7 +42,8 @@ func testAccCheckDBSubnetGroupDestroy(s *terraform.State) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to find the resource
|
// 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 err == nil {
|
||||||
if len(resp.DBSubnetGroups) > 0 {
|
if len(resp.DBSubnetGroups) > 0 {
|
||||||
return fmt.Errorf("still exist.")
|
return fmt.Errorf("still exist.")
|
||||||
|
@ -76,7 +77,8 @@ func testAccCheckDBSubnetGroupExists(n string, v *rds.DBSubnetGroup) resource.Te
|
||||||
}
|
}
|
||||||
|
|
||||||
conn := testAccProvider.Meta().(*AWSClient).rdsconn
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,7 +219,7 @@ func resourceAwsEipDelete(d *schema.ResourceData, meta interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if _, ok := err.(*ec2.Error); !ok {
|
if _, ok := err.(*ec2.Error); !ok {
|
||||||
return resource.RetryError{err}
|
return resource.RetryError{Err: err}
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -124,7 +124,7 @@ func resourceAwsInternetGatewayDelete(d *schema.ResourceData, meta interface{})
|
||||||
return err // retry
|
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)
|
return fmt.Errorf("Dependency violation: Cannot delete acl %s: %s", d.Id(), err)
|
||||||
}
|
}
|
||||||
_, err = ec2conn.ReplaceNetworkAclAssociation(association.NetworkAclAssociationId, defaultAcl.NetworkAclId)
|
_, err = ec2conn.ReplaceNetworkAclAssociation(association.NetworkAclAssociationId, defaultAcl.NetworkAclId)
|
||||||
return resource.RetryError{err}
|
return resource.RetryError{Err: err}
|
||||||
default:
|
default:
|
||||||
// Any other error, we want to quit the retry loop immediately
|
// 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())
|
log.Printf("[Info] Deleted network ACL %s successfully", d.Id())
|
||||||
|
|
|
@ -380,7 +380,7 @@ func resourceAwsSecurityGroupDelete(d *schema.ResourceData, meta interface{}) er
|
||||||
return err
|
return err
|
||||||
default:
|
default:
|
||||||
// Any other error, we want to quit the retry loop immediately
|
// 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