Skip to content

Commit 43fa651

Browse files
authored
tgc: check both old and new TGC compilers (#15465)
1 parent 67e11e6 commit 43fa651

21 files changed

+24
-24
lines changed

mmv1/api/type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ func (t *Type) GetPrefix() string {
548548
if t.ParentMetadata == nil {
549549
nestedPrefix := ""
550550
// TODO: Use the nestedPrefix for tgc provider to be consistent with terraform provider
551-
if t.ResourceMetadata.NestedQuery != nil && t.ResourceMetadata.Compiler != "terraformgoogleconversion-codegen" {
551+
if t.ResourceMetadata.NestedQuery != nil && !strings.Contains(t.ResourceMetadata.Compiler, "terraformgoogleconversion") {
552552
nestedPrefix = "Nested"
553553
}
554554

mmv1/templates/terraform/constants/agent_pool.go.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if ne $.Compiler "terraformgoogleconversion-codegen" }}
1+
{{- if not (contains $.Compiler "terraformgoogleconversion") }}
22
// waitForAgentPoolReady waits for an agent pool to leave the
33
// "CREATING" state and become "CREATED", to indicate that it's ready.
44
func waitForAgentPoolReady(d *schema.ResourceData, config *transport_tpg.Config, timeout time.Duration) error {

mmv1/templates/terraform/constants/apigee_nat_address.go.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if ne $.Compiler "terraformgoogleconversion-codegen" }}
1+
{{- if not (contains $.Compiler "terraformgoogleconversion") }}
22
// waitForNatAddressReady waits for an NatAddress to leave the
33
// "CREATING" state and become "RESERVED", to indicate that it's ready.
44
func waitForNatAddressReserved(d *schema.ResourceData, config *transport_tpg.Config, timeout time.Duration) error {

mmv1/templates/terraform/constants/bigquery_data_transfer.go.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ func sensitiveParamCustomizeDiff(_ context.Context, diff *schema.ResourceDiff, v
1010
}
1111
}
1212

13-
{{- if ne $.Compiler "terraformgoogleconversion-codegen" }}
13+
{{- if not (contains $.Compiler "terraformgoogleconversion") }}
1414
for _, sp := range sensitiveWoParams {
1515
mapLabel := diff.Get("params." + sp[:len(sp)-3]).(string)
1616
authLabel, _ := diff.GetRawConfigAt(cty.GetAttrPath("sensitive_params").IndexInt(0).GetAttr(sp))

mmv1/templates/terraform/constants/clouddomains_registration.go.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if ne $.Compiler "terraformgoogleconversion-codegen" }}
1+
{{- if not (contains $.Compiler "terraformgoogleconversion") }}
22
// waitForRegistrationActive waits for a registration to leave the
33
// "REGISTRATION_PENDING" state and become "ACTIVE" or any other state.
44
func waitForRegistrationActive(d *schema.ResourceData, config *transport_tpg.Config, timeout time.Duration) error {

mmv1/templates/terraform/constants/colab_runtime.go.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func ModifyColabRuntimeOperation(config *transport_tpg.Config, d *schema.Resourc
1717
return res, nil
1818
}
1919

20-
{{- if ne $.Compiler "terraformgoogleconversion-codegen" }}
20+
{{- if not (contains $.Compiler "terraformgoogleconversion") }}
2121
func waitForColabOperation(config *transport_tpg.Config, d *schema.ResourceData, project string, billingProject string, userAgent string, response map[string]interface{}) error {
2222
var opRes map[string]interface{}
2323
err := ColabOperationWaitTimeWithResponse(

mmv1/templates/terraform/constants/integration_connectors_connection.go.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if ne $.Compiler "terraformgoogleconversion-codegen" }}
1+
{{- if not (contains $.Compiler "terraformgoogleconversion") }}
22
// waitforConnectionReady waits for an connecion to leave the
33
// "CREATING" state, to indicate that it's ready.
44
func waitforConnectionReady(d *schema.ResourceData, config *transport_tpg.Config, timeout time.Duration) error {

mmv1/templates/terraform/constants/interconnect_attachment.go.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if ne $.Compiler "terraformgoogleconversion-codegen" }}
1+
{{- if not (contains $.Compiler "terraformgoogleconversion") }}
22
// waitForAttachmentToBeProvisioned waits for an attachment to leave the
33
// "UNPROVISIONED" state, to indicate that it's either ready or awaiting partner
44
// activity.

mmv1/templates/terraform/constants/notebooks_instance.go.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func NotebooksInstanceKmsDiffSuppress(_, old, new string, _ *schema.ResourceData
4848
return false
4949
}
5050

51-
{{- if ne $.Compiler "terraformgoogleconversion-codegen" }}
51+
{{- if not (contains $.Compiler "terraformgoogleconversion") }}
5252
// waitForNotebooksInstanceActive waits for an Notebook instance to become "ACTIVE"
5353
func waitForNotebooksInstanceActive(d *schema.ResourceData, config *transport_tpg.Config, timeout time.Duration) error {
5454
return retry.Retry(timeout, func() *retry.RetryError {
@@ -88,7 +88,7 @@ func modifyNotebooksInstanceState(config *transport_tpg.Config, d *schema.Resour
8888
return res, nil
8989
}
9090

91-
{{- if ne $.Compiler "terraformgoogleconversion-codegen" }}
91+
{{- if not (contains $.Compiler "terraformgoogleconversion") }}
9292
func waitForNotebooksOperation(config *transport_tpg.Config, d *schema.ResourceData, project string, billingProject string, userAgent string, response map[string]interface{}) error {
9393
var opRes map[string]interface{}
9494
err := NotebooksOperationWaitTimeWithResponse(

mmv1/templates/terraform/constants/org_policy_policy.go.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ func resourceOrgpolicyPolicyRulesConditionExpressionDiffSuppress(_, old, new str
44
return oldReplaced == newReplaced
55
}
66

7-
{{- if ne $.Compiler "terraformgoogleconversion-codegen" }}
7+
{{- if not (contains $.Compiler "terraformgoogleconversion") }}
88
func resourceOrgPolicyPolicySpecRulesDiffSuppress(k, o, n string, d *schema.ResourceData) bool {
99
oldCount, newCount := d.GetChange("spec.0.rules.#")
1010
var count int

0 commit comments

Comments
 (0)