Skip to content

Commit

Permalink
Add ignore read on reservedIpRange field Filestore Instance (GoogleCl…
Browse files Browse the repository at this point in the history
…oudPlatform#8520)

Co-authored-by: Shuya Ma <[email protected]>
  • Loading branch information
2 people authored and nevzheng committed Aug 25, 2023
1 parent 8511383 commit 7a5ccb4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions mmv1/products/filestore/Instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ properties:
A /29 CIDR block that identifies the range of IP
addresses reserved for this instance.
default_from_api: true
# When using connectMode=PRIVATE_SERVICE_ACCESS, the returned value
# won't match the sent value as the returned value is an IP range
# from the provided named range.
custom_flatten: templates/terraform/custom_flatten/filestore_instance_networks_reserved_ip_range.go.erb
- !ruby/object:Api::Type::Array
name: 'ipAddresses'
description: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<%# The license inside this block applies to this file.
# Copyright 2018 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-%>
func flatten<%= prefix -%><%= titlelize_property(property) -%>(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
return d.Get("networks.0.reserved_ip_range")
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func TestAccFilestoreInstance_reservedIpRange_update(t *testing.T) {
ResourceName: "google_filestore_instance.instance",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"zone", "location"},
ImportStateVerifyIgnore: []string{"zone", "location", "networks.0.reserved_ip_range"},
},
{
Config: testAccFilestoreInstance_reservedIpRange_update2(name),
Expand All @@ -143,7 +143,7 @@ func TestAccFilestoreInstance_reservedIpRange_update(t *testing.T) {
ResourceName: "google_filestore_instance.instance",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"zone", "location"},
ImportStateVerifyIgnore: []string{"zone", "location", "networks.0.reserved_ip_range"},
},
},
})
Expand Down

0 comments on commit 7a5ccb4

Please sign in to comment.