Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/google: Support Import of 'google_compute_instance_template' #8147

Merged
merged 1 commit into from
Aug 18, 2016

Conversation

nwwebb
Copy link
Contributor

@nwwebb nwwebb commented Aug 11, 2016

% make testacc TEST=./builtin/providers/google TESTARGS='-run=TestAccComputeInstanceTemplate_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/google -v -run=TestAccComputeInstanceTemplate_ -timeout 120m
=== RUN   TestAccComputeInstanceTemplate_importBasic
--- PASS: TestAccComputeInstanceTemplate_importBasic (27.36s)
=== RUN   TestAccComputeInstanceTemplate_importIp
--- PASS: TestAccComputeInstanceTemplate_importIp (52.18s)
=== RUN   TestAccComputeInstanceTemplate_importDisks
--- PASS: TestAccComputeInstanceTemplate_importDisks (27.42s)
=== RUN   TestAccComputeInstanceTemplate_importSubnetAuto
--- PASS: TestAccComputeInstanceTemplate_importSubnetAuto (140.49s)
=== RUN   TestAccComputeInstanceTemplate_importSubnetCustom
--- PASS: TestAccComputeInstanceTemplate_importSubnetCustom (95.10s)
=== RUN   TestAccComputeInstanceTemplate_basic
--- PASS: TestAccComputeInstanceTemplate_basic (27.06s)
=== RUN   TestAccComputeInstanceTemplate_IP
--- PASS: TestAccComputeInstanceTemplate_IP (52.22s)
=== RUN   TestAccComputeInstanceTemplate_disks
--- PASS: TestAccComputeInstanceTemplate_disks (27.33s)
=== RUN   TestAccComputeInstanceTemplate_subnet_auto
--- PASS: TestAccComputeInstanceTemplate_subnet_auto (129.91s)
=== RUN   TestAccComputeInstanceTemplate_subnet_custom
--- PASS: TestAccComputeInstanceTemplate_subnet_custom (86.55s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/google 
665.682s

@lwander

@@ -134,7 +143,6 @@ func resourceComputeInstanceTemplate() *schema.Resource {
"automatic_restart": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Default: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you verified that this works without automatic_restart set? Also removing this default could be dangerous to existing configs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lwander you are correct - if we are going to change a default, then we may possibly need a state_migration

Copy link
Contributor Author

@nwwebb nwwebb Aug 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure a state_migration will be able to fix the issue. Previously a config without auto_restart or scheduler set will create an instance group manager with a default scheduler that has auto_restart set to true (which seems like odd behavior to me). Taking away this default will make configs such as this plan to destroy the scheduler. To keep the scheduler it seems like I would need to migrate configs rather than states somehow. Thoughts on this? @stack72

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I just went into the gce api and if scheduler is not specified it will still make a scheduler with the default attributes, so keeping the default should be fine. I'm going to make the other properties of the scheduler have defaults set to avoid confusion in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! One last little change, since your adding a default to preemptible, could you make it clear that the default is false in the docs? https://github.com/hashicorp/terraform/blob/master/website/source/docs/providers/google/r/compute_instance_template.html.markdown

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the docs

@nwwebb nwwebb force-pushed the import-instance-template branch 3 times, most recently from a08929e to 377fc1a Compare August 12, 2016 21:03
@lwander lwander merged commit 23ab7ee into hashicorp:master Aug 18, 2016
@ghost
Copy link

ghost commented Apr 23, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants