Skip to content

Commit

Permalink
Fix BillingBudget sweeper (#3420) (#6201)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Apr 24, 2020
1 parent 604de62 commit e8e6316
Show file tree
Hide file tree
Showing 80 changed files with 714 additions and 316 deletions.
3 changes: 3 additions & 0 deletions .changelog/3420.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
13 changes: 9 additions & 4 deletions google/resource_app_engine_domain_mapping_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepAppEngineDomainMapping(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
13 changes: 9 additions & 4 deletions google/resource_bigquery_data_transfer_config_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepBigqueryDataTransferConfig(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
13 changes: 9 additions & 4 deletions google/resource_binary_authorization_attestor_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepBinaryAuthorizationAttestor(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
13 changes: 9 additions & 4 deletions google/resource_cloud_build_trigger_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepCloudBuildTrigger(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
13 changes: 9 additions & 4 deletions google/resource_cloud_run_domain_mapping_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepCloudRunDomainMapping(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
13 changes: 9 additions & 4 deletions google/resource_cloud_run_service_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepCloudRunService(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
13 changes: 9 additions & 4 deletions google/resource_cloud_scheduler_job_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepCloudSchedulerJob(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
13 changes: 9 additions & 4 deletions google/resource_cloud_tasks_queue_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepCloudTasksQueue(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
13 changes: 9 additions & 4 deletions google/resource_compute_address_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepComputeAddress(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
13 changes: 9 additions & 4 deletions google/resource_compute_autoscaler_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepComputeAutoscaler(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepComputeBackendBucketSignedUrlKey(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
13 changes: 9 additions & 4 deletions google/resource_compute_backend_bucket_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepComputeBackendBucket(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
Expand Down Expand Up @@ -46,13 +47,17 @@ func testSweepComputeBackendServiceSignedUrlKey(region string) error {
return err
}

t := &testing.T{}
billingId := getTestBillingAccountFromEnv(t)

// Setup variables to replace in list template
d := &ResourceDataMock{
FieldsInSchema: map[string]interface{}{
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"project": config.Project,
"region": region,
"location": region,
"zone": "-",
"billing_account": billingId,
},
}

Expand Down
Loading

0 comments on commit e8e6316

Please sign in to comment.