From c19190f403dfcc9a35f3b6e5389edf7f286f393e Mon Sep 17 00:00:00 2001 From: Jon Ward Date: Thu, 20 Jan 2022 15:02:49 +0000 Subject: [PATCH 1/2] if trigger type is event_based, set schedule to event_based --- provider/resource_replication.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/provider/resource_replication.go b/provider/resource_replication.go index c222711..06de6a3 100644 --- a/provider/resource_replication.go +++ b/provider/resource_replication.go @@ -146,11 +146,13 @@ func resourceReplicationRead(d *schema.ResourceData, m interface{}) error { d.Set("registry_id", destRegistryID) } - if jsonDataReplication.Trigger.Type == "scheduled" { - d.Set("schedule", jsonDataReplication.Trigger.TriggerSettings.Cron) - } else { - d.Set("schedule", "manual") - } + switch jsonDataReplication.Trigger.Type { + case "scheduled": + d.Set("schedule", jsonDataReplication.Trigger.TriggerSettings.Cron) + case "event_based": + d.Set("schedule", "event_based") + default: + d.Set("schedule", "manual") d.Set("replication_policy_id", jsonDataReplication.ID) d.Set("enabled", jsonDataReplication.Enabled) From 27a367b56d4076c22c73573d54cded373167f3f0 Mon Sep 17 00:00:00 2001 From: Jon Ward Date: Thu, 20 Jan 2022 15:15:50 +0000 Subject: [PATCH 2/2] add missing brace --- provider/resource_replication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/provider/resource_replication.go b/provider/resource_replication.go index 06de6a3..a701d90 100644 --- a/provider/resource_replication.go +++ b/provider/resource_replication.go @@ -153,6 +153,7 @@ func resourceReplicationRead(d *schema.ResourceData, m interface{}) error { d.Set("schedule", "event_based") default: d.Set("schedule", "manual") + } d.Set("replication_policy_id", jsonDataReplication.ID) d.Set("enabled", jsonDataReplication.Enabled)