Skip to content

Commit 516c389

Browse files
committed
lint
1 parent e5b9b2b commit 516c389

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

docs/resources/autoscaling_instance_policy.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ resource "scaleway_autoscaling_instance_policy" "down" {
4646
sampling_range_min = 5
4747
threshold = 40
4848
}
49+
}
4950
```
5051

5152
## Argument Reference

internal/services/autoscaling/testfuncs/sweep.go

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ func AddTestSweepers() {
3030
func testSweepInstanceGroup(_ string) error {
3131
return acctest.SweepZones((&autoscaling.API{}).Zones(), func(scwClient *scw.Client, zone scw.Zone) error {
3232
autoscalingAPI := autoscaling.NewAPI(scwClient)
33+
3334
logging.L.Debugf("sweeper: destroying the autoscaling instance groups in (%s)", zone)
35+
3436
listInstanceGroups, err := autoscalingAPI.ListInstanceGroups(
3537
&autoscaling.ListInstanceGroupsRequest{
3638
Zone: zone,
3739
}, scw.WithAllPages())
3840
if err != nil {
39-
return fmt.Errorf("error listing instancegroup in (%s) in sweeper: %s", zone, err)
41+
return fmt.Errorf("error listing instancegroup in (%s) in sweeper: %w", zone, err)
4042
}
4143

4244
for _, instanceGroup := range listInstanceGroups.InstanceGroups {
@@ -45,9 +47,9 @@ func testSweepInstanceGroup(_ string) error {
4547
Zone: zone,
4648
})
4749
if err != nil {
48-
logging.L.Debugf("sweeper: error (%s)", err)
50+
logging.L.Debugf("sweeper: error (%w)", err)
4951

50-
return fmt.Errorf("error deleting instance group in sweeper: %s", err)
52+
return fmt.Errorf("error deleting instance group in sweeper: %w", err)
5153
}
5254
}
5355

@@ -58,13 +60,15 @@ func testSweepInstanceGroup(_ string) error {
5860
func testSweepInstanceTemplate(_ string) error {
5961
return acctest.SweepZones((&autoscaling.API{}).Zones(), func(scwClient *scw.Client, zone scw.Zone) error {
6062
autoscalingAPI := autoscaling.NewAPI(scwClient)
63+
6164
logging.L.Debugf("sweeper: destroying the autoscaling instance templates in (%s)", zone)
65+
6266
listInstanceTemplates, err := autoscalingAPI.ListInstanceTemplates(
6367
&autoscaling.ListInstanceTemplatesRequest{
6468
Zone: zone,
6569
}, scw.WithAllPages())
6670
if err != nil {
67-
return fmt.Errorf("error listing instance templates in (%s) in sweeper: %s", zone, err)
71+
return fmt.Errorf("error listing instance templates in (%s) in sweeper: %w", zone, err)
6872
}
6973

7074
for _, instanceTemplate := range listInstanceTemplates.InstanceTemplates {
@@ -73,9 +77,9 @@ func testSweepInstanceTemplate(_ string) error {
7377
Zone: zone,
7478
})
7579
if err != nil {
76-
logging.L.Debugf("sweeper: error (%s)", err)
80+
logging.L.Debugf("sweeper: error (%w)", err)
7781

78-
return fmt.Errorf("error deleting instance template in sweeper: %s", err)
82+
return fmt.Errorf("error deleting instance template in sweeper: %w", err)
7983
}
8084
}
8185

@@ -86,13 +90,14 @@ func testSweepInstanceTemplate(_ string) error {
8690
func testSweepInstancePolicy(_ string) error {
8791
return acctest.SweepZones((&autoscaling.API{}).Zones(), func(scwClient *scw.Client, zone scw.Zone) error {
8892
autoscalingAPI := autoscaling.NewAPI(scwClient)
93+
8994
logging.L.Debugf("sweeper: destroying the autoscaling instance policies in (%s)", zone)
90-
listInstancePolicies, err := autoscalingAPI.ListInstancePolicies(
91-
&autoscaling.ListInstancePoliciesRequest{
92-
Zone: zone,
93-
}, scw.WithAllPages())
95+
96+
listInstancePolicies, err := autoscalingAPI.ListInstancePolicies(&autoscaling.ListInstancePoliciesRequest{
97+
Zone: zone,
98+
}, scw.WithAllPages())
9499
if err != nil {
95-
return fmt.Errorf("error listing instance policy in (%s) in sweeper: %s", zone, err)
100+
return fmt.Errorf("error listing instance policy in (%s) in sweeper: %w", zone, err)
96101
}
97102

98103
for _, instancePolicy := range listInstancePolicies.Policies {
@@ -101,9 +106,9 @@ func testSweepInstancePolicy(_ string) error {
101106
Zone: zone,
102107
})
103108
if err != nil {
104-
logging.L.Debugf("sweeper: error (%s)", err)
109+
logging.L.Debugf("sweeper: error (%w)", err)
105110

106-
return fmt.Errorf("error deleting instance policy in sweeper: %s", err)
111+
return fmt.Errorf("error deleting instance policy in sweeper: %w", err)
107112
}
108113
}
109114

0 commit comments

Comments
 (0)