diff --git a/mmv1/third_party/terraform/resources/resource_compute_instance.go.erb b/mmv1/third_party/terraform/resources/resource_compute_instance.go.erb index 2cbd692ce48e..802cc0df6b86 100644 --- a/mmv1/third_party/terraform/resources/resource_compute_instance.go.erb +++ b/mmv1/third_party/terraform/resources/resource_compute_instance.go.erb @@ -50,9 +50,7 @@ var ( "scheduling.0.preemptible", "scheduling.0.node_affinities", "scheduling.0.min_node_cpus", -<% unless version == 'ga' -%> "scheduling.0.provisioning_model", -<% end -%> } shieldedInstanceConfigKeys = []string{ @@ -628,7 +626,6 @@ func resourceComputeInstance() *schema.Resource { Optional: true, AtLeastOneOf: schedulingKeys, }, - <% unless version == 'ga' -%> "provisioning_model": { Type: schema.TypeString, Optional: true, @@ -637,7 +634,6 @@ func resourceComputeInstance() *schema.Resource { AtLeastOneOf: schedulingKeys, Description: `Whether the instance is spot. If this is set as SPOT.`, }, -<% end -%> }, }, }, diff --git a/mmv1/third_party/terraform/resources/resource_compute_instance_template.go.erb b/mmv1/third_party/terraform/resources/resource_compute_instance_template.go.erb index 6ab03c479863..5cd62e722abf 100644 --- a/mmv1/third_party/terraform/resources/resource_compute_instance_template.go.erb +++ b/mmv1/third_party/terraform/resources/resource_compute_instance_template.go.erb @@ -29,9 +29,7 @@ var ( "scheduling.0.preemptible", "scheduling.0.node_affinities", "scheduling.0.min_node_cpus", -<% unless version == 'ga' -%> "scheduling.0.provisioning_model", - <% end -%> } shieldedInstanceTemplateConfigKeys = []string{ @@ -539,7 +537,6 @@ func resourceComputeInstanceTemplate() *schema.Resource { AtLeastOneOf: schedulingInstTemplateKeys, Description: `Minimum number of cpus for the instance.`, }, -<% unless version == 'ga' -%> "provisioning_model": { Type: schema.TypeString, Optional: true, @@ -548,7 +545,6 @@ func resourceComputeInstanceTemplate() *schema.Resource { AtLeastOneOf: schedulingInstTemplateKeys, Description: `Whether the instance is spot. If this is set as SPOT.`, }, -<% end -%> }, }, }, diff --git a/mmv1/third_party/terraform/tests/resource_compute_instance_template_test.go.erb b/mmv1/third_party/terraform/tests/resource_compute_instance_template_test.go.erb index 0f6918205d15..d42871024f67 100644 --- a/mmv1/third_party/terraform/tests/resource_compute_instance_template_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_compute_instance_template_test.go.erb @@ -1080,7 +1080,6 @@ func TestAccComputeInstanceTemplate_queueCount(t *testing.T) { }) } -<% unless version == 'ga' -%> func TestAccComputeInstanceTemplate_spot(t *testing.T) { t.Parallel() @@ -1109,7 +1108,6 @@ func TestAccComputeInstanceTemplate_spot(t *testing.T) { }, }) } -<% end -%> func testAccCheckComputeInstanceTemplateDestroyProducer(t *testing.T) func(s *terraform.State) error { return func(s *terraform.State) error { @@ -1258,7 +1256,6 @@ func testAccCheckComputeInstanceTemplatePreemptible(instanceTemplate *compute.In } } -<% unless version == 'ga' -%> func testAccCheckComputeInstanceTemplateProvisioningModel(instanceTemplate *compute.InstanceTemplate, provisioning_model string) resource.TestCheckFunc { return func(s *terraform.State) error { if instanceTemplate.Properties.Scheduling.ProvisioningModel != provisioning_model { @@ -1267,7 +1264,6 @@ func testAccCheckComputeInstanceTemplateProvisioningModel(instanceTemplate *comp return nil } } -<% end -%> func testAccCheckComputeInstanceTemplateAutomaticRestart(instanceTemplate *compute.InstanceTemplate, automaticRestart bool) resource.TestCheckFunc { @@ -2731,7 +2727,6 @@ resource "google_compute_instance_template" "foobar" { `, instanceTemplateName) } -<% unless version == 'ga' -%> func testAccComputeInstanceTemplate_spot(suffix string) string { return fmt.Sprintf(` data "google_compute_image" "my_image" { @@ -2771,6 +2766,4 @@ resource "google_compute_instance_template" "foobar" { } `, suffix) } -<% end -%> - diff --git a/mmv1/third_party/terraform/tests/resource_compute_instance_test.go.erb b/mmv1/third_party/terraform/tests/resource_compute_instance_test.go.erb index 2e55f099c32c..e350b7db6441 100644 --- a/mmv1/third_party/terraform/tests/resource_compute_instance_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_compute_instance_test.go.erb @@ -2217,7 +2217,6 @@ func TestAccComputeInstance_queueCount(t *testing.T) { }) } -<% unless version == 'ga' -%> func TestAccComputeInstance_spotVM(t *testing.T) { t.Parallel() @@ -2271,7 +2270,6 @@ func TestAccComputeInstance_spotVM_update(t *testing.T) { }, }) } -<% end -%> func TestComputeInstance_networkIPCustomizedDiff(t *testing.T) { t.Parallel() @@ -6238,7 +6236,6 @@ resource "google_compute_instance" "foobar" { `, instance) } -<% unless version == 'ga' -%> func testAccComputeInstance_spotVM(instance string) string { return fmt.Sprintf(` data "google_compute_image" "my_image" { @@ -6270,6 +6267,4 @@ resource "google_compute_instance" "foobar" { } `, instance) } -<% end -%> - diff --git a/mmv1/third_party/terraform/utils/compute_instance_helpers.go.erb b/mmv1/third_party/terraform/utils/compute_instance_helpers.go.erb index e8ca33bab86e..3aa481483bbe 100644 --- a/mmv1/third_party/terraform/utils/compute_instance_helpers.go.erb +++ b/mmv1/third_party/terraform/utils/compute_instance_helpers.go.erb @@ -123,12 +123,10 @@ func expandScheduling(v interface{}) (*compute.Scheduling, error) { if v, ok := original["min_node_cpus"]; ok { scheduling.MinNodeCpus = int64(v.(int)) } -<% unless version == 'ga' -%> if v, ok := original["provisioning_model"]; ok { scheduling.ProvisioningModel = v.(string) scheduling.ForceSendFields = append(scheduling.ForceSendFields, "ProvisioningModel") } -<% end -%> return scheduling, nil } @@ -137,9 +135,7 @@ func flattenScheduling(resp *compute.Scheduling) []map[string]interface{} { "on_host_maintenance": resp.OnHostMaintenance, "preemptible": resp.Preemptible, "min_node_cpus": resp.MinNodeCpus, -<% unless version == 'ga' -%> "provisioning_model": resp.ProvisioningModel, -<% end -%> } if resp.AutomaticRestart != nil { @@ -484,11 +480,9 @@ func schedulingHasChangeWithoutReboot(d *schema.ResourceData) bool { return true } -<% unless version == 'ga' -%> if oScheduling["provisioning_model"] != newScheduling["provisioning_model"] { return true } -<% end -%> return false } diff --git a/mmv1/third_party/validator/compute_instance.go.erb b/mmv1/third_party/validator/compute_instance.go.erb index 988173c54285..c9ba96f38d1b 100644 --- a/mmv1/third_party/validator/compute_instance.go.erb +++ b/mmv1/third_party/validator/compute_instance.go.erb @@ -125,9 +125,7 @@ func expandComputeInstance(project string, d TerraformResourceData, config *Conf AutomaticRestart: googleapi.Bool(d.Get(prefix + ".automatic_restart").(bool)), Preemptible: d.Get(prefix + ".preemptible").(bool), OnHostMaintenance: d.Get(prefix + ".on_host_maintenance").(string), -<% unless version == 'ga' -%> ProvisioningModel: d.Get(prefix + ".provisioning_model").(string), -<% end -%> ForceSendFields: []string{"AutomaticRestart", "Preemptible"}, } }