Skip to content

Commit 7c110b7

Browse files
tgc-revival: Add tgc ha vpn gateway, storage pool and privateca resources (#15951)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 0dabc2d commit 7c110b7

File tree

6 files changed

+32
-4
lines changed

6 files changed

+32
-4
lines changed

mmv1/products/compute/HaVpnGateway.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ async:
4141
resource_inside_response: false
4242
collection_url_key: 'items'
4343
custom_code:
44+
include_in_tgc_next: true
45+
tgc_include_handwritten_tests: true
4446
schema_version: 1
4547
state_upgraders: true
4648
examples:

mmv1/products/compute/StoragePool.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,3 +292,5 @@ virtual_fields:
292292
When the field is set to false, deleting the StoragePool is allowed.
293293
custom_code:
294294
pre_delete: templates/terraform/pre_delete/compute_storage_pool.go.tmpl
295+
include_in_tgc_next: true
296+
tgc_include_handwritten_tests: true

mmv1/products/privateca/CaPool.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ iam_policy:
4848
iam_conditions_request_type: 'QUERY_PARAM_NESTED'
4949
example_config_body: 'templates/terraform/iam/example_config_body/privateca_ca_pool.tf.tmpl'
5050
custom_code:
51+
tgc_decoder: 'templates/tgc_next/decoders/privateca_capool.go.tmpl'
5152
examples:
5253
- name: 'privateca_capool_basic'
5354
primary_resource_id: 'default'
@@ -70,6 +71,8 @@ examples:
7071
my_certificate: 'my-certificate'
7172
exclude_test: true
7273
exclude_docs: true
74+
include_in_tgc_next: true
75+
tgc_include_handwritten_tests: true
7376
parameters:
7477
- name: 'location'
7578
type: String

mmv1/provider/terraform_tgc_next.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,10 @@ func (tgc TerraformGoogleConversionNext) CopyCommonFiles(outputFolder string, ge
245245
"pkg/version/version.go": "third_party/terraform/version/version.go",
246246

247247
// services
248-
"pkg/services/compute/image.go": "third_party/terraform/services/compute/image.go",
249-
"pkg/services/compute/disk_type.go": "third_party/terraform/services/compute/disk_type.go",
250-
"pkg/services/kms/kms_utils.go": "third_party/terraform/services/kms/kms_utils.go",
248+
"pkg/services/compute/image.go": "third_party/terraform/services/compute/image.go",
249+
"pkg/services/compute/disk_type.go": "third_party/terraform/services/compute/disk_type.go",
250+
"pkg/services/kms/kms_utils.go": "third_party/terraform/services/kms/kms_utils.go",
251+
"pkg/services/privateca/privateca_utils.go": "third_party/terraform/services/privateca/privateca_utils.go",
251252
}
252253
tgc.CopyFileList(outputFolder, resourceConverters)
253254
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
if ip, ok := res["issuancePolicy"]; ok && ip != nil {
2+
if ipMap, ok := ip.(map[string]interface{}); ok {
3+
if bv, ok := ipMap["baselineValues"]; ok && bv != nil {
4+
if bvMap, ok := bv.(map[string]interface{}); ok {
5+
if ae, ok := bvMap["additionalExtensions"]; ok && ae != nil {
6+
if aeList, ok := ae.([]interface{}); ok {
7+
for _, item := range aeList {
8+
if itemMap, ok := item.(map[string]interface{}); ok {
9+
if _, ok := itemMap["critical"]; !ok {
10+
itemMap["critical"] = false
11+
}
12+
}
13+
}
14+
}
15+
}
16+
}
17+
}
18+
}
19+
}
20+
return res, hclData, nil

mmv1/third_party/tgc_next/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test-integration:
1818
go version
1919
terraform --version
2020
./config-tf-dev-override.sh
21-
TF_CLI_CONFIG_FILE="$${PWD}/${TF_CONFIG_FILE}" GO111MODULE=on go test -run=TestAcc $(TESTPATH) $(TESTARGS) -timeout 30m -v ./...
21+
TF_CLI_CONFIG_FILE="$${PWD}/${TF_CONFIG_FILE}" GO111MODULE=on go test -run=TestAcc $(TESTPATH) $(TESTARGS) -parallel 8 -timeout 30m -v ./...
2222

2323
mod-clean:
2424
git restore go.mod

0 commit comments

Comments
 (0)