Skip to content

Commit

Permalink
Fix tests by stabilising rolling_update_policy, making update_policy …
Browse files Browse the repository at this point in the history
…Computed, and ImportStateVerifyIgnore-ing update_strategy for rigm.
  • Loading branch information
rileykarson authored and modular-magician committed Nov 21, 2018
1 parent f4a17d7 commit 5f6dc4c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
Computed: true,
<% else -%>
"update_policy": &schema.Schema{
Computed: true,
<% end -%>
Type: schema.TypeList,
Optional: true,
Expand Down Expand Up @@ -538,6 +539,7 @@ func resourceComputeInstanceGroupManagerRead(d *schema.ResourceData, meta interf

// When we make a list Removed, we see a permadiff from `field_name.#: "" => "<computed>"`. Set to nil in Read so we see no diff.
d.Set("version" , nil)
d.Set("rolling_update_policy" , nil)
<% else -%>
if err = d.Set("auto_healing_policies", flattenAutoHealingPolicies(manager.AutoHealingPolicies)); err != nil {
return fmt.Errorf("Error setting auto_healing_policies in state: %s", err.Error())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource {
Computed: true,
<% else -%>
"update_policy": &schema.Schema{
Computed: true,
<% end -%>
Type: schema.TypeList,
Optional: true,
Expand Down Expand Up @@ -477,6 +478,7 @@ func resourceComputeRegionInstanceGroupManagerRead(d *schema.ResourceData, meta
<% if version.nil? || version == 'ga' -%>
// When we make a list Removed, we see a permadiff from `field_name.#: "" => "<computed>"`. Set to nil in Read so we see no diff.
d.Set("version" , nil)
d.Set("rolling_update_policy" , nil)
<% else -%>
if err := d.Set("auto_healing_policies", flattenAutoHealingPolicies(manager.AutoHealingPolicies)); err != nil {
return fmt.Errorf("Error setting auto_healing_policies in state: %s", err.Error())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@ func TestAccRegionInstanceGroupManager_updateStrategy(t *testing.T) {
Config: testAccRegionInstanceGroupManager_updateStrategy(igm),
},
{
ResourceName: "google_compute_region_instance_group_manager.igm-update-strategy",
ImportState: true,
ImportStateVerify: true,
ResourceName: "google_compute_region_instance_group_manager.igm-update-strategy",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"update_strategy"},
},
},
})
Expand Down

0 comments on commit 5f6dc4c

Please sign in to comment.