Skip to content

Commit f6aa93a

Browse files
added functionality in mmv1 to support configurable sweepers (#10650) (#7358)
[upstream:398f07b4afc179e3af98ee17b50f1f181d2d607b] Signed-off-by: Modular Magician <[email protected]>
1 parent 1ead9d0 commit f6aa93a

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

google-beta/services/datacatalog/resource_data_catalog_taxonomy_sweeper.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
// Copyright (c) HashiCorp, Inc.
22
// SPDX-License-Identifier: MPL-2.0
3+
4+
// ----------------------------------------------------------------------------
5+
//
6+
// *** AUTO GENERATED CODE *** Type: MMv1 ***
7+
//
8+
// ----------------------------------------------------------------------------
9+
//
10+
// This file is automatically generated by Magic Modules and manual
11+
// changes will be clobbered when the file is regenerated.
12+
//
13+
// Please read more about how to change this file in
14+
// .github/CONTRIBUTING.md.
15+
//
16+
// ----------------------------------------------------------------------------
17+
318
package datacatalog
419

520
import (
@@ -49,7 +64,7 @@ func testSweepDataCatalogTaxonomy(region string) error {
4964
},
5065
}
5166

52-
listTemplate := strings.Split("https://datacatalog.googleapis.com/v1/projects/{{project}}/locations/{{region}}/taxonomies", "?")[0]
67+
listTemplate := strings.Split("https://datacatalog.googleapis.com/v1beta1/projects/{{project}}/locations/{{region}}/taxonomies", "?")[0]
5368
listUrl, err := tpgresource.ReplaceVars(d, config, listTemplate)
5469
if err != nil {
5570
log.Printf("[INFO][SWEEPER_LOG] error preparing sweeper list url: %s", err)
@@ -88,12 +103,12 @@ func testSweepDataCatalogTaxonomy(region string) error {
88103

89104
name := tpgresource.GetResourceNameFromSelfLink(obj["name"].(string))
90105
// Skip resources that shouldn't be sweeped
91-
if !sweeper.IsSweepableTestResource(name) {
106+
if !sweeper.IsSweepableTestResource(obj["displayName"].(string)) {
92107
nonPrefixCount++
93108
continue
94109
}
95110

96-
deleteTemplate := "https://datacatalog.googleapis.com/v1/{{display_name}}"
111+
deleteTemplate := "https://datacatalog.googleapis.com/v1beta1/{{name}}"
97112
deleteUrl, err := tpgresource.ReplaceVars(d, config, deleteTemplate)
98113
if err != nil {
99114
log.Printf("[INFO][SWEEPER_LOG] error preparing delete url: %s", err)

0 commit comments

Comments
 (0)