Skip to content

Commit

Permalink
Keep version Required in the beta provider
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisst committed Nov 2, 2019
1 parent 6289795 commit 6444ada
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ func resourceComputeInstanceGroupManager() *schema.Resource {

"version": &schema.Schema{
Type: schema.TypeList,
<%# TODO 3.0.0 - mark as required -%>
<% if version == 'ga' -%>
Optional: true,
Computed: true,
<%# TODO 3.0.0 - mark as required -%>
<% else -%>
Required: true,
<% end -%>
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource {
"version": &schema.Schema{
<%# TODO 3.0.0 - mark as required -%>
Type: schema.TypeList,
<% if version == 'ga' -%>
Optional: true,
Computed: true,
<% else -%>
Required: true,
<% end -%>
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Expand Down Expand Up @@ -361,10 +365,9 @@ func resourceComputeRegionInstanceGroupManagerCreate(d *schema.ResourceData, met
Name: d.Get("name").(string),
Description: d.Get("description").(string),
BaseInstanceName: d.Get("base_instance_name").(string),
<% if version == 'ga' -%>
<% if version == 'ga' -%>
InstanceTemplate: d.Get("instance_template").(string),
<% end -%> <% end -%>
<% end -%>
TargetSize: int64(d.Get("target_size").(int)),
NamedPorts: getNamedPortsBeta(d.Get("named_port").(*schema.Set).List()),
TargetPools: convertStringSet(d.Get("target_pools").(*schema.Set)),
Expand Down Expand Up @@ -486,7 +489,6 @@ func resourceComputeRegionInstanceGroupManagerRead(d *schema.ResourceData, meta
d.Set("self_link", ConvertSelfLinkToV1(manager.SelfLink))

<% if version == 'ga' -%>
// rolling_update_policy
d.Set("rolling_update_policy" , nil)
<% end -%>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ The following arguments are supported:
* `version` - (Optional) Application versions managed by this instance group. Each
version deals with a specific instance template, allowing canary release scenarios.
Structure is documented below.
Until `instance_template` is removed this field will be Optional to allow for a
graceful upgrade. In the Beta provider and as of 3.0.0 it will be Required.

* `name` - (Required) The name of the instance group manager. Must be 1-63
characters long and comply with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ The following arguments are supported:
* `version` - (Optional) Application versions managed by this instance group. Each
version deals with a specific instance template, allowing canary release scenarios.
Structure is documented below.
Until `instance_template` is removed this field will be Optional to allow for a
graceful upgrade. In the Beta provider and as of 3.0.0 it will be Required.

* `name` - (Required) The name of the instance group manager. Must be 1-63
characters long and comply with
Expand Down

0 comments on commit 6444ada

Please sign in to comment.