Skip to content

Commit ac056ac

Browse files
fix sweepers for resources with overridden names (#14756) (#23903)
[upstream:3497e67827984001f69943b4cd9938ea4fcd326a] Signed-off-by: Modular Magician <[email protected]>
1 parent eb4ad74 commit ac056ac

File tree

30 files changed

+60
-60
lines changed

30 files changed

+60
-60
lines changed

google/services/bigqueryanalyticshub/resource_bigquery_analytics_hub_listing_subscription_sweeper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ func listAndActionBigqueryAnalyticsHubListingSubscription(action sweeper.Resourc
140140
}
141141

142142
// First try the expected resource key
143-
resourceList, ok := res["listingSubscriptions"]
143+
resourceList, ok := res["subscriptions"]
144144
if ok {
145-
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'listingSubscriptions'")
145+
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'subscriptions'")
146146
} else {
147147
// Next, try the common "items" pattern
148148
resourceList, ok = res["items"]

google/services/cloudbuild/resource_cloudbuild_trigger_sweeper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ func listAndActionCloudBuildTrigger(action sweeper.ResourceAction) error {
142142
}
143143

144144
// First try the expected resource key
145-
resourceList, ok := res["triggers"]
145+
resourceList, ok := res["buildTriggers"]
146146
if ok {
147-
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'triggers'")
147+
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'buildTriggers'")
148148
} else {
149149
// Next, try the common "items" pattern
150150
resourceList, ok = res["items"]

google/services/colab/resource_colab_notebook_execution_sweeper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ func listAndActionColabNotebookExecution(action sweeper.ResourceAction) error {
142142
}
143143

144144
// First try the expected resource key
145-
resourceList, ok := res["notebookExecutions"]
145+
resourceList, ok := res["notebookExecutionJobs"]
146146
if ok {
147-
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'notebookExecutions'")
147+
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'notebookExecutionJobs'")
148148
} else {
149149
// Next, try the common "items" pattern
150150
resourceList, ok = res["items"]

google/services/colab/resource_colab_runtime_sweeper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ func listAndActionColabRuntime(action sweeper.ResourceAction) error {
142142
}
143143

144144
// First try the expected resource key
145-
resourceList, ok := res["runtimes"]
145+
resourceList, ok := res["notebookRuntimes"]
146146
if ok {
147-
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'runtimes'")
147+
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'notebookRuntimes'")
148148
} else {
149149
// Next, try the common "items" pattern
150150
resourceList, ok = res["items"]

google/services/colab/resource_colab_runtime_template_sweeper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ func listAndActionColabRuntimeTemplate(action sweeper.ResourceAction) error {
142142
}
143143

144144
// First try the expected resource key
145-
resourceList, ok := res["runtimeTemplates"]
145+
resourceList, ok := res["notebookRuntimeTemplates"]
146146
if ok {
147-
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'runtimeTemplates'")
147+
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'notebookRuntimeTemplates'")
148148
} else {
149149
// Next, try the common "items" pattern
150150
resourceList, ok = res["items"]

google/services/compute/resource_compute_network_firewall_policy_sweeper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ func listAndActionComputeNetworkFirewallPolicy(action sweeper.ResourceAction) er
142142
}
143143

144144
// First try the expected resource key
145-
resourceList, ok := res["networkFirewallPolicies"]
145+
resourceList, ok := res["firewallPolicies"]
146146
if ok {
147-
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'networkFirewallPolicies'")
147+
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'firewallPolicies'")
148148
} else {
149149
// Next, try the common "items" pattern
150150
resourceList, ok = res["items"]

google/services/compute/resource_compute_network_firewall_policy_with_rules_sweeper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ func listAndActionComputeNetworkFirewallPolicyWithRules(action sweeper.ResourceA
142142
}
143143

144144
// First try the expected resource key
145-
resourceList, ok := res["networkFirewallPolicyWithRules"]
145+
resourceList, ok := res["firewallPolicies"]
146146
if ok {
147-
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'networkFirewallPolicyWithRules'")
147+
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'firewallPolicies'")
148148
} else {
149149
// Next, try the common "items" pattern
150150
resourceList, ok = res["items"]

google/services/compute/resource_compute_region_network_firewall_policy_sweeper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ func listAndActionComputeRegionNetworkFirewallPolicy(action sweeper.ResourceActi
142142
}
143143

144144
// First try the expected resource key
145-
resourceList, ok := res["regionNetworkFirewallPolicies"]
145+
resourceList, ok := res["firewallPolicies"]
146146
if ok {
147-
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'regionNetworkFirewallPolicies'")
147+
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'firewallPolicies'")
148148
} else {
149149
// Next, try the common "items" pattern
150150
resourceList, ok = res["items"]

google/services/compute/resource_compute_region_network_firewall_policy_with_rules_sweeper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ func listAndActionComputeRegionNetworkFirewallPolicyWithRules(action sweeper.Res
140140
}
141141

142142
// First try the expected resource key
143-
resourceList, ok := res["regionNetworkFirewallPolicyWithRules"]
143+
resourceList, ok := res["firewallPolicies"]
144144
if ok {
145-
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'regionNetworkFirewallPolicyWithRules'")
145+
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'firewallPolicies'")
146146
} else {
147147
// Next, try the common "items" pattern
148148
resourceList, ok = res["items"]

google/services/compute/resource_compute_region_security_policy_sweeper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ func listAndActionComputeRegionSecurityPolicy(action sweeper.ResourceAction) err
152152
}
153153

154154
// First try the expected resource key
155-
resourceList, ok := res["regionSecurityPolicies"]
155+
resourceList, ok := res["securityPolicies"]
156156
if ok {
157-
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'regionSecurityPolicies'")
157+
log.Printf("[INFO][SWEEPER_LOG] Found resources under expected key 'securityPolicies'")
158158
} else {
159159
// Next, try the common "items" pattern
160160
resourceList, ok = res["items"]

0 commit comments

Comments
 (0)