Skip to content

Commit

Permalink
diff suppress empty value for start time of day
Browse files Browse the repository at this point in the history
  • Loading branch information
emilymye authored and modular-magician committed May 21, 2019
1 parent a0f3f93 commit 9052914
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions third_party/terraform/resources/resource_storage_transfer_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
},
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 9052914

Please sign in to comment.