Skip to content

Commit

Permalink
Moving Ansible fingerprint to match TF
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
rambleraptor authored and modular-magician committed Dec 6, 2019
1 parent 72bdd64 commit 3535ebc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
29 changes: 6 additions & 23 deletions google-beta/resource_compute_subnetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,6 @@ must be unique within the subnetwork.`,
Computed: true,
Description: `Creation timestamp in RFC3339 text format.`,
},
"fingerprint": {
Type: schema.TypeString,
Computed: true,
Description: `Fingerprint of this resource. This field is used internally during
updates of this resource.`,
},
"gateway_address": {
Type: schema.TypeString,
Computed: true,
Expand All @@ -250,6 +244,12 @@ outside this subnetwork.`,
Optional: true,
Removed: "This field is being removed in favor of log_config. If log_config is present, flow logs are enabled. Please remove this field",
},
"fingerprint": {
Type: schema.TypeString,
Computed: true,
Description: "Fingerprint of this resource. This field is used internally during updates of this resource.",
Deprecated: "This field is not useful for users, and has been removed as an output.",
},
"project": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -334,12 +334,6 @@ func resourceComputeSubnetworkCreate(d *schema.ResourceData, meta interface{}) e
} else if v, ok := d.GetOkExists("network"); !isEmptyValue(reflect.ValueOf(networkProp)) && (ok || !reflect.DeepEqual(v, networkProp)) {
obj["network"] = networkProp
}
fingerprintProp, err := expandComputeSubnetworkFingerprint(d.Get("fingerprint"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("fingerprint"); !isEmptyValue(reflect.ValueOf(fingerprintProp)) && (ok || !reflect.DeepEqual(v, fingerprintProp)) {
obj["fingerprint"] = fingerprintProp
}
purposeProp, err := expandComputeSubnetworkPurpose(d.Get("purpose"), d, config)
if err != nil {
return err
Expand Down Expand Up @@ -453,9 +447,6 @@ func resourceComputeSubnetworkRead(d *schema.ResourceData, meta interface{}) err
if err := d.Set("network", flattenComputeSubnetworkNetwork(res["network"], d)); err != nil {
return fmt.Errorf("Error reading Subnetwork: %s", err)
}
if err := d.Set("fingerprint", flattenComputeSubnetworkFingerprint(res["fingerprint"], d)); err != nil {
return fmt.Errorf("Error reading Subnetwork: %s", err)
}
if err := d.Set("purpose", flattenComputeSubnetworkPurpose(res["purpose"], d)); err != nil {
return fmt.Errorf("Error reading Subnetwork: %s", err)
}
Expand Down Expand Up @@ -766,10 +757,6 @@ func flattenComputeSubnetworkNetwork(v interface{}, d *schema.ResourceData) inte
return ConvertSelfLinkToV1(v.(string))
}

func flattenComputeSubnetworkFingerprint(v interface{}, d *schema.ResourceData) interface{} {
return v
}

func flattenComputeSubnetworkPurpose(v interface{}, d *schema.ResourceData) interface{} {
return v
}
Expand Down Expand Up @@ -857,10 +844,6 @@ func expandComputeSubnetworkNetwork(v interface{}, d TerraformResourceData, conf
return f.RelativeLink(), nil
}

func expandComputeSubnetworkFingerprint(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}

func expandComputeSubnetworkPurpose(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}
Expand Down
4 changes: 0 additions & 4 deletions website/docs/r/compute_subnetwork.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,6 @@ In addition to the arguments listed above, the following computed attributes are
* `gateway_address` -
The gateway address for default routes to reach destination addresses
outside this subnetwork.

* `fingerprint` -
Fingerprint of this resource. This field is used internally during
updates of this resource.
* `self_link` - The URI of the created resource.


Expand Down

0 comments on commit 3535ebc

Please sign in to comment.