Skip to content

Commit

Permalink
if trigger type is event_based, set schedule to event_based
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Ward committed Jan 20, 2022
1 parent e1d12e8 commit c19190f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions provider/resource_replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c19190f

Please sign in to comment.