Removing create_timeout from compute image (#2244)

This commit is contained in:
Chris Stephens 2018-10-12 09:04:47 -07:00 committed by Nathan McKinley
parent c4db896d39
commit 192684a7f6
3 changed files with 5 additions and 15 deletions

View File

@ -94,9 +94,9 @@ func resourceComputeImage() *schema.Resource {
},
"create_timeout": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
Deprecated: "Use timeouts block instead. See https://www.terraform.io/docs/configuration/resources.html#timeouts.",
Type: schema.TypeInt,
Optional: true,
Removed: "Use timeouts block instead. See https://www.terraform.io/docs/configuration/resources.html#timeouts.",
},
"labels": &schema.Schema{
@ -172,12 +172,7 @@ func resourceComputeImageCreate(d *schema.ResourceData, meta interface{}) error
}
// Read create timeout
var createTimeout int
if v, ok := d.GetOk("create_timeout"); ok {
createTimeout = v.(int)
} else {
createTimeout = int(d.Timeout(schema.TimeoutCreate).Minutes())
}
createTimeout := int(d.Timeout(schema.TimeoutCreate).Minutes())
// Insert the image
op, err := config.clientCompute.Images.Insert(

View File

@ -100,7 +100,7 @@ func TestAccComputeImage_update(t *testing.T) {
ResourceName: "google_compute_image.foobar",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"raw_disk", "create_timeout"},
ImportStateVerifyIgnore: []string{"raw_disk"},
},
},
})
@ -274,7 +274,6 @@ resource "google_compute_image" "foobar" {
raw_disk {
source = "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz"
}
create_timeout = 5
labels = {
my-label = "my-label-value"
empty-label = ""
@ -291,7 +290,6 @@ resource "google_compute_image" "foobar" {
raw_disk {
source = "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz"
}
create_timeout = 5
labels = {
my-label = "my-label-value"
empty-label = ""
@ -311,7 +309,6 @@ resource "google_compute_image" "foobar" {
raw_disk {
source = "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz"
}
create_timeout = 5
labels = {
empty-label = "oh-look-theres-a-label-now"
new-field = "only-shows-up-when-updated"

View File

@ -74,8 +74,6 @@ The following arguments are supported: (Note that one of either source_disk or
* `licenses` - (Optional) A list of license URIs to apply to this image. Changing this
forces a new resource to be created.
* `create_timeout` - (Deprecated) Configurable timeout in minutes for creating images. Default is 4 minutes.
The `raw_disk` block supports:
* `source` - (Required) The full Google Cloud Storage URL where the disk