From 31aa8443cefde3ceefa156d1188628d1e0fd4d86 Mon Sep 17 00:00:00 2001 From: The Magician Date: Mon, 20 May 2019 12:59:06 -0700 Subject: [PATCH] Diff suppress storage transfer job start_time_of_day (#3655) Signed-off-by: Modular Magician --- google/data_source_google_client_config.go | 6 ------ google/data_source_google_client_config_test.go | 1 - google/resource_storage_transfer_job.go | 15 ++++++++++----- .../docs/d/datasource_client_config.html.markdown | 2 -- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/google/data_source_google_client_config.go b/google/data_source_google_client_config.go index e202ed17e67..90f01aca24a 100644 --- a/google/data_source_google_client_config.go +++ b/google/data_source_google_client_config.go @@ -20,11 +20,6 @@ func dataSourceGoogleClientConfig() *schema.Resource { Computed: true, }, - "zone": { - Type: schema.TypeString, - Computed: true, - }, - "access_token": { Type: schema.TypeString, Computed: true, @@ -40,7 +35,6 @@ func dataSourceClientConfigRead(d *schema.ResourceData, meta interface{}) error d.SetId(time.Now().UTC().String()) d.Set("project", config.Project) d.Set("region", config.Region) - d.Set("zone", config.Zone) token, err := config.tokenSource.Token() if err != nil { diff --git a/google/data_source_google_client_config_test.go b/google/data_source_google_client_config_test.go index 108678ee3a1..b6b355e5c20 100644 --- a/google/data_source_google_client_config_test.go +++ b/google/data_source_google_client_config_test.go @@ -20,7 +20,6 @@ func TestAccDataSourceGoogleClientConfig_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet(resourceName, "project"), resource.TestCheckResourceAttrSet(resourceName, "region"), - resource.TestCheckResourceAttrSet(resourceName, "zone"), resource.TestCheckResourceAttrSet(resourceName, "access_token"), ), }, diff --git a/google/resource_storage_transfer_job.go b/google/resource_storage_transfer_job.go index 6526c58a82e..e9a5b15372b 100644 --- a/google/resource_storage_transfer_job.go +++ b/google/resource_storage_transfer_job.go @@ -96,11 +96,12 @@ func resourceStorageTransferJob() *schema.Resource { Elem: dateObjectSchema(), }, "start_time_of_day": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - MaxItems: 1, - Elem: timeObjectSchema(), + Type: schema.TypeList, + Optional: true, + ForceNew: true, + MaxItems: 1, + Elem: timeObjectSchema(), + DiffSuppressFunc: diffSuppressEmptyStartTimeOfDay, }, }, }, @@ -301,6 +302,10 @@ func httpDataSchema() *schema.Resource { } } +func diffSuppressEmptyStartTimeOfDay(k, old, new string, d *schema.ResourceData) bool { + return k == "schedule.0.start_time_of_day.#" && old == "1" && new == "0" +} + func resourceStorageTransferJobCreate(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) diff --git a/website/docs/d/datasource_client_config.html.markdown b/website/docs/d/datasource_client_config.html.markdown index 4b888c8ce03..52f02029a49 100644 --- a/website/docs/d/datasource_client_config.html.markdown +++ b/website/docs/d/datasource_client_config.html.markdown @@ -51,6 +51,4 @@ In addition to the arguments listed above, the following attributes are exported * `region` - The region to operate under. -* `zone` - The zone to operate under. - * `access_token` - The OAuth2 access token used by the client to authenticate against the Google Cloud API.