Skip to content

Commit

Permalink
Merge pull request #183 from jonwtech/read_event_based_replication_tr…
Browse files Browse the repository at this point in the history
…igger

Set replication schedule to 'event_based' if that's the trigger type
  • Loading branch information
wrighbr authored Jan 21, 2022
2 parents e1d12e8 + 27a367b commit 1259566
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions provider/resource_replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +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)
Expand Down

0 comments on commit 1259566

Please sign in to comment.