Skip to content

Commit b081e8c

Browse files
Support ignore_read on nested fields (#10639) (#7400)
[upstream:428508734e366159823eda04e20ccffead07eeaa] Signed-off-by: Modular Magician <[email protected]>
1 parent 6ced89d commit b081e8c

8 files changed

+59
-48
lines changed

google-beta/services/compute/resource_compute_backend_service_generated_test.go

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ func TestAccComputeBackendService_backendServiceBasicExample(t *testing.T) {
4646
Config: testAccComputeBackendService_backendServiceBasicExample(context),
4747
},
4848
{
49-
ResourceName: "google_compute_backend_service.default",
50-
ImportState: true,
51-
ImportStateVerify: true,
49+
ResourceName: "google_compute_backend_service.default",
50+
ImportState: true,
51+
ImportStateVerify: true,
52+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"},
5253
},
5354
},
5455
})
@@ -125,9 +126,10 @@ func TestAccComputeBackendService_backendServiceCacheSimpleExample(t *testing.T)
125126
Config: testAccComputeBackendService_backendServiceCacheSimpleExample(context),
126127
},
127128
{
128-
ResourceName: "google_compute_backend_service.default",
129-
ImportState: true,
130-
ImportStateVerify: true,
129+
ResourceName: "google_compute_backend_service.default",
130+
ImportState: true,
131+
ImportStateVerify: true,
132+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"},
131133
},
132134
},
133135
})
@@ -169,9 +171,10 @@ func TestAccComputeBackendService_backendServiceCacheIncludeHttpHeadersExample(t
169171
Config: testAccComputeBackendService_backendServiceCacheIncludeHttpHeadersExample(context),
170172
},
171173
{
172-
ResourceName: "google_compute_backend_service.default",
173-
ImportState: true,
174-
ImportStateVerify: true,
174+
ResourceName: "google_compute_backend_service.default",
175+
ImportState: true,
176+
ImportStateVerify: true,
177+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"},
175178
},
176179
},
177180
})
@@ -211,9 +214,10 @@ func TestAccComputeBackendService_backendServiceCacheIncludeNamedCookiesExample(
211214
Config: testAccComputeBackendService_backendServiceCacheIncludeNamedCookiesExample(context),
212215
},
213216
{
214-
ResourceName: "google_compute_backend_service.default",
215-
ImportState: true,
216-
ImportStateVerify: true,
217+
ResourceName: "google_compute_backend_service.default",
218+
ImportState: true,
219+
ImportStateVerify: true,
220+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"},
217221
},
218222
},
219223
})
@@ -256,9 +260,10 @@ func TestAccComputeBackendService_backendServiceCacheExample(t *testing.T) {
256260
Config: testAccComputeBackendService_backendServiceCacheExample(context),
257261
},
258262
{
259-
ResourceName: "google_compute_backend_service.default",
260-
ImportState: true,
261-
ImportStateVerify: true,
263+
ResourceName: "google_compute_backend_service.default",
264+
ImportState: true,
265+
ImportStateVerify: true,
266+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"},
262267
},
263268
},
264269
})
@@ -305,9 +310,10 @@ func TestAccComputeBackendService_backendServiceCacheBypassCacheOnRequestHeaders
305310
Config: testAccComputeBackendService_backendServiceCacheBypassCacheOnRequestHeadersExample(context),
306311
},
307312
{
308-
ResourceName: "google_compute_backend_service.default",
309-
ImportState: true,
310-
ImportStateVerify: true,
313+
ResourceName: "google_compute_backend_service.default",
314+
ImportState: true,
315+
ImportStateVerify: true,
316+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"},
311317
},
312318
},
313319
})
@@ -362,9 +368,10 @@ func TestAccComputeBackendService_backendServiceTrafficDirectorRoundRobinExample
362368
Config: testAccComputeBackendService_backendServiceTrafficDirectorRoundRobinExample(context),
363369
},
364370
{
365-
ResourceName: "google_compute_backend_service.default",
366-
ImportState: true,
367-
ImportStateVerify: true,
371+
ResourceName: "google_compute_backend_service.default",
372+
ImportState: true,
373+
ImportStateVerify: true,
374+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"},
368375
},
369376
},
370377
})
@@ -408,9 +415,10 @@ func TestAccComputeBackendService_backendServiceTrafficDirectorRingHashExample(t
408415
Config: testAccComputeBackendService_backendServiceTrafficDirectorRingHashExample(context),
409416
},
410417
{
411-
ResourceName: "google_compute_backend_service.default",
412-
ImportState: true,
413-
ImportStateVerify: true,
418+
ResourceName: "google_compute_backend_service.default",
419+
ImportState: true,
420+
ImportStateVerify: true,
421+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"},
414422
},
415423
},
416424
})
@@ -470,9 +478,10 @@ func TestAccComputeBackendService_backendServiceNetworkEndpointExample(t *testin
470478
Config: testAccComputeBackendService_backendServiceNetworkEndpointExample(context),
471479
},
472480
{
473-
ResourceName: "google_compute_backend_service.default",
474-
ImportState: true,
475-
ImportStateVerify: true,
481+
ResourceName: "google_compute_backend_service.default",
482+
ImportState: true,
483+
ImportStateVerify: true,
484+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"},
476485
},
477486
},
478487
})
@@ -527,9 +536,10 @@ func TestAccComputeBackendService_backendServiceExternalManagedExample(t *testin
527536
Config: testAccComputeBackendService_backendServiceExternalManagedExample(context),
528537
},
529538
{
530-
ResourceName: "google_compute_backend_service.default",
531-
ImportState: true,
532-
ImportStateVerify: true,
539+
ResourceName: "google_compute_backend_service.default",
540+
ImportState: true,
541+
ImportStateVerify: true,
542+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret"},
533543
},
534544
},
535545
})

google-beta/services/compute/resource_compute_region_backend_service_generated_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestAccComputeRegionBackendService_regionBackendServiceBasicExample(t *test
4949
ResourceName: "google_compute_region_backend_service.default",
5050
ImportState: true,
5151
ImportStateVerify: true,
52-
ImportStateVerifyIgnore: []string{"network", "region"},
52+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret", "network", "region"},
5353
},
5454
},
5555
})
@@ -136,7 +136,7 @@ func TestAccComputeRegionBackendService_regionBackendServiceCacheExample(t *test
136136
ResourceName: "google_compute_region_backend_service.default",
137137
ImportState: true,
138138
ImportStateVerify: true,
139-
ImportStateVerifyIgnore: []string{"network", "region"},
139+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret", "network", "region"},
140140
},
141141
},
142142
})
@@ -197,7 +197,7 @@ func TestAccComputeRegionBackendService_regionBackendServiceIlbRoundRobinExample
197197
ResourceName: "google_compute_region_backend_service.default",
198198
ImportState: true,
199199
ImportStateVerify: true,
200-
ImportStateVerifyIgnore: []string{"network", "region"},
200+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret", "network", "region"},
201201
},
202202
},
203203
})
@@ -242,7 +242,7 @@ func TestAccComputeRegionBackendService_regionBackendServiceExternalExample(t *t
242242
ResourceName: "google_compute_region_backend_service.default",
243243
ImportState: true,
244244
ImportStateVerify: true,
245-
ImportStateVerifyIgnore: []string{"network", "region"},
245+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret", "network", "region"},
246246
},
247247
},
248248
})
@@ -290,7 +290,7 @@ func TestAccComputeRegionBackendService_regionBackendServiceExternalWeightedExam
290290
ResourceName: "google_compute_region_backend_service.default",
291291
ImportState: true,
292292
ImportStateVerify: true,
293-
ImportStateVerifyIgnore: []string{"network", "region"},
293+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret", "network", "region"},
294294
},
295295
},
296296
})
@@ -337,7 +337,7 @@ func TestAccComputeRegionBackendService_regionBackendServiceIlbRingHashExample(t
337337
ResourceName: "google_compute_region_backend_service.default",
338338
ImportState: true,
339339
ImportStateVerify: true,
340-
ImportStateVerifyIgnore: []string{"network", "region"},
340+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret", "network", "region"},
341341
},
342342
},
343343
})
@@ -398,7 +398,7 @@ func TestAccComputeRegionBackendService_regionBackendServiceBalancingModeExample
398398
ResourceName: "google_compute_region_backend_service.default",
399399
ImportState: true,
400400
ImportStateVerify: true,
401-
ImportStateVerifyIgnore: []string{"network", "region"},
401+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret", "network", "region"},
402402
},
403403
},
404404
})
@@ -499,7 +499,7 @@ func TestAccComputeRegionBackendService_regionBackendServiceConnectionTrackingEx
499499
ResourceName: "google_compute_region_backend_service.default",
500500
ImportState: true,
501501
ImportStateVerify: true,
502-
ImportStateVerifyIgnore: []string{"network", "region"},
502+
ImportStateVerifyIgnore: []string{"iap.0.oauth2_client_secret", "network", "region"},
503503
},
504504
},
505505
})

google-beta/services/compute/resource_compute_snapshot_generated_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestAccComputeSnapshot_snapshotBasicExample(t *testing.T) {
4949
ResourceName: "google_compute_snapshot.snapshot",
5050
ImportState: true,
5151
ImportStateVerify: true,
52-
ImportStateVerifyIgnore: []string{"labels", "source_disk", "source_disk_encryption_key", "terraform_labels", "zone"},
52+
ImportStateVerifyIgnore: []string{"labels", "snapshot_encryption_key.0.raw_key", "source_disk", "source_disk_encryption_key", "terraform_labels", "zone"},
5353
},
5454
},
5555
})
@@ -101,7 +101,7 @@ func TestAccComputeSnapshot_snapshotChainnameExample(t *testing.T) {
101101
ResourceName: "google_compute_snapshot.snapshot",
102102
ImportState: true,
103103
ImportStateVerify: true,
104-
ImportStateVerifyIgnore: []string{"labels", "source_disk", "source_disk_encryption_key", "terraform_labels", "zone"},
104+
ImportStateVerifyIgnore: []string{"labels", "snapshot_encryption_key.0.raw_key", "source_disk", "source_disk_encryption_key", "terraform_labels", "zone"},
105105
},
106106
},
107107
})

google-beta/services/dialogflowcx/resource_dialogflow_cx_agent_generated_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestAccDialogflowCXAgent_dialogflowcxAgentFullExample(t *testing.T) {
4949
ResourceName: "google_dialogflow_cx_agent.full_agent",
5050
ImportState: true,
5151
ImportStateVerify: true,
52-
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token", "location"},
52+
ImportStateVerifyIgnore: []string{"git_integration_settings.0.github_settings.0.access_token", "git_integration_settings.0.github_settings.0.access_token", "location"},
5353
},
5454
},
5555
})

google-beta/services/vertexai/data_source_vertex_ai_index_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ func TestAccDataSourceVertexAIIndex_basic(t *testing.T) {
3131
"google_vertex_ai_index.index",
3232
// The projects.locations.indexes.get doesn't return the following fields
3333
map[string]struct{}{
34-
"metadata.0.contents_delta_uri": {},
35-
"metadata.0.is_complete_overwrite": {},
34+
"metadata.0.config.0.feature_norm_type": {},
35+
"metadata.0.contents_delta_uri": {},
36+
"metadata.0.is_complete_overwrite": {},
3637
},
3738
),
3839
),

google-beta/services/vertexai/resource_vertex_ai_index.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ func flattenVertexAIIndexMetadataConfigDistanceMeasureType(v interface{}, d *sch
811811
}
812812

813813
func flattenVertexAIIndexMetadataConfigFeatureNormType(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
814-
return v
814+
return d.Get("metadata.0.config.0.feature_norm_type")
815815
}
816816

817817
func flattenVertexAIIndexMetadataConfigAlgorithmConfig(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {

google-beta/services/vertexai/resource_vertex_ai_index_generated_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func TestAccVertexAIIndex_vertexAiIndexExample(t *testing.T) {
5151
ResourceName: "google_vertex_ai_index.index",
5252
ImportState: true,
5353
ImportStateVerify: true,
54-
ImportStateVerifyIgnore: []string{"etag", "labels", "metadata.0.contents_delta_uri", "metadata.0.is_complete_overwrite", "region", "terraform_labels"},
54+
ImportStateVerifyIgnore: []string{"etag", "labels", "metadata.0.config.0.feature_norm_type", "metadata.0.contents_delta_uri", "metadata.0.is_complete_overwrite", "region", "terraform_labels"},
5555
},
5656
},
5757
})
@@ -123,7 +123,7 @@ func TestAccVertexAIIndex_vertexAiIndexStreamingExample(t *testing.T) {
123123
ResourceName: "google_vertex_ai_index.index",
124124
ImportState: true,
125125
ImportStateVerify: true,
126-
ImportStateVerifyIgnore: []string{"etag", "labels", "metadata.0.contents_delta_uri", "metadata.0.is_complete_overwrite", "region", "terraform_labels"},
126+
ImportStateVerifyIgnore: []string{"etag", "labels", "metadata.0.config.0.feature_norm_type", "metadata.0.contents_delta_uri", "metadata.0.is_complete_overwrite", "region", "terraform_labels"},
127127
},
128128
},
129129
})

google-beta/services/vertexai/resource_vertex_ai_index_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestAccVertexAIIndex_updated(t *testing.T) {
3636
ResourceName: "google_vertex_ai_index.index",
3737
ImportState: true,
3838
ImportStateVerify: true,
39-
ImportStateVerifyIgnore: []string{"etag", "region", "metadata.0.contents_delta_uri", "metadata.0.is_complete_overwrite", "labels", "terraform_labels"},
39+
ImportStateVerifyIgnore: []string{"etag", "region", "metadata.0.contents_delta_uri", "metadata.0.is_complete_overwrite", "metadata.0.config.0.feature_norm_type", "labels", "terraform_labels"},
4040
},
4141
{
4242
Config: testAccVertexAIIndex_updated(context),
@@ -45,7 +45,7 @@ func TestAccVertexAIIndex_updated(t *testing.T) {
4545
ResourceName: "google_vertex_ai_index.index",
4646
ImportState: true,
4747
ImportStateVerify: true,
48-
ImportStateVerifyIgnore: []string{"etag", "region", "metadata.0.contents_delta_uri", "metadata.0.is_complete_overwrite", "labels", "terraform_labels"},
48+
ImportStateVerifyIgnore: []string{"etag", "region", "metadata.0.contents_delta_uri", "metadata.0.is_complete_overwrite", "metadata.0.config.0.feature_norm_type", "labels", "terraform_labels"},
4949
},
5050
},
5151
})

0 commit comments

Comments
 (0)