Skip to content

Commit

Permalink
draft glue trigger #8
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Sushkov (teeverr) committed Oct 14, 2024
1 parent 7c0de96 commit 2dd9f47
Show file tree
Hide file tree
Showing 2 changed files with 474 additions and 71 deletions.
7 changes: 4 additions & 3 deletions pkg/controller/glue/trigger/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,9 @@ func createPatch(currentParams *svcapitypes.TriggerParameters, resp *svcsdk.GetT
externalConfig := &svcapitypes.TriggerParameters{}
externalConfig.Schedule = resp.Trigger.Schedule
if resp.Trigger.Predicate != nil {
externalConfig.Predicate = &svcapitypes.Predicate{}
if resp.Trigger.Predicate.Conditions != nil {
externalConfig.Predicate.Conditions = make([]*svcapitypes.Condition, 0, len(resp.Trigger.Predicate.Conditions))
externalConfig.Predicate = &svcapitypes.Predicate{Conditions: make([]*svcapitypes.Condition, 0, len(resp.Trigger.Predicate.Conditions))}
for _, respCondition := range resp.Trigger.Predicate.Conditions {
curCondition := &svcapitypes.Condition{}
if respCondition.CrawlState != nil {
Expand All @@ -277,8 +278,8 @@ func createPatch(currentParams *svcapitypes.TriggerParameters, resp *svcsdk.GetT
externalConfig.Predicate.Conditions = append(externalConfig.Predicate.Conditions, curCondition)
}
}
if resp.Trigger.Predicate.Logical != nil {
externalConfig.Predicate.Logical = resp.Trigger.Predicate.Logical
if resp.Trigger.Predicate != nil && resp.Trigger.Predicate.Logical != nil {
externalConfig.Predicate = &svcapitypes.Predicate{Logical: resp.Trigger.Predicate.Logical}
}
}
if resp.Trigger.Actions != nil {
Expand Down
Loading

0 comments on commit 2dd9f47

Please sign in to comment.