set force_destroy on import (#1223)

This commit is contained in:
Dana Hoffman 2018-03-19 16:37:39 -07:00 committed by GitHub
parent d7295334fa
commit e9ab089260
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 16 deletions

View File

@ -498,6 +498,7 @@ func resourceStorageBucketDelete(d *schema.ResourceData, meta interface{}) error
func resourceStorageBucketStateImporter(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { func resourceStorageBucketStateImporter(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
d.Set("name", d.Id()) d.Set("name", d.Id())
d.Set("force_destroy", false)
return []*schema.ResourceData{d}, nil return []*schema.ResourceData{d}, nil
} }

View File

@ -39,10 +39,9 @@ func TestAccStorageBucket_basic(t *testing.T) {
), ),
}, },
resource.TestStep{ resource.TestStep{
ResourceName: "google_storage_bucket.bucket", ResourceName: "google_storage_bucket.bucket",
ImportState: true, ImportState: true,
ImportStateVerify: true, ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"force_destroy"},
}, },
}, },
}) })
@ -145,10 +144,9 @@ func TestAccStorageBucket_lifecycleRules(t *testing.T) {
), ),
}, },
resource.TestStep{ resource.TestStep{
ResourceName: "google_storage_bucket.bucket", ResourceName: "google_storage_bucket.bucket",
ImportState: true, ImportState: true,
ImportStateVerify: true, ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"force_destroy"},
}, },
}, },
}) })
@ -201,10 +199,9 @@ func TestAccStorageBucket_storageClass(t *testing.T) {
), ),
}, },
{ {
ResourceName: "google_storage_bucket.bucket", ResourceName: "google_storage_bucket.bucket",
ImportState: true, ImportState: true,
ImportStateVerify: true, ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"force_destroy"},
}, },
}, },
}) })
@ -386,10 +383,9 @@ func TestAccStorageBucket_versioning(t *testing.T) {
), ),
}, },
resource.TestStep{ resource.TestStep{
ResourceName: "google_storage_bucket.bucket", ResourceName: "google_storage_bucket.bucket",
ImportState: true, ImportState: true,
ImportStateVerify: true, ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"force_destroy"},
}, },
}, },
}) })