From 7eee7a3fbaf2fee21cfc66b546bfef6e57c10f8d Mon Sep 17 00:00:00 2001 From: flbla Date: Tue, 17 Nov 2020 16:23:06 +0100 Subject: [PATCH] avoid gc custom cron to be re-created/updated every time if there is no need to update --- provider/resource_garbage_collection.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/provider/resource_garbage_collection.go b/provider/resource_garbage_collection.go index c0ad925..8dfeb35 100644 --- a/provider/resource_garbage_collection.go +++ b/provider/resource_garbage_collection.go @@ -63,7 +63,11 @@ func resourceGCRead(d *schema.ResourceData, m interface{}) error { fmt.Println(err) } - d.Set("schedule", strings.ToLower(jsonData.Schedule.Type)) + if jsonData.Schedule.Type == "Custom" { + d.Set("schedule", jsonData.Schedule.Cron) + } else { + d.Set("schedule", strings.ToLower(jsonData.Schedule.Type)) + } d.Set("delete_untagged", jsonJobParameters.DeleteUntagged) return nil }