RichardW98 commented on code in PR #350:
URL:
https://github.com/apache/incubator-kie-kogito-serverless-operator/pull/350#discussion_r1453894689
##########
controllers/profiles/common/mutate_visitors.go:
##########
@@ -103,6 +106,41 @@ func ServiceMutateVisitor(workflow
*operatorapi.SonataFlow) MutateVisitor {
}
}
+func SinkBindingMutateVisitor(workflow *operatorapi.SonataFlow) MutateVisitor {
+ return func(object client.Object) controllerutil.MutateFn {
+ return func() error {
+ if kubeutil.IsObjectNew(object) {
+ return nil
+ }
+ original, err := SinkBindingCreator(workflow)
+ if err != nil {
+ return err
+ }
+ return mergo.Merge(&object.(*v1.SinkBinding).Spec,
original.(*v1.SinkBinding).Spec, mergo.WithOverride)
+ }
+ }
+}
+
+func TriggerMutateVisitor(workflow *operatorapi.SonataFlow) MutateVisitor {
+ return func(object client.Object) controllerutil.MutateFn {
+ return func() error {
+ if kubeutil.IsObjectNew(object) {
+ return nil
+ }
+ originals, err := TriggersCreator(workflow)
+ if err != nil {
+ return err
+ }
+ for _, original := range originals {
+ if original.GetName() == object.GetName() {
+ return
mergo.Merge(&object.(*v12.Trigger).Spec, original.(*v12.Trigger).Spec,
mergo.WithOverride)
Review Comment:
<img width="555" alt="Screenshot 2024-01-11 at 9 21 31 AM"
src="https://github.com/apache/incubator-kie-kogito-serverless-operator/assets/58698556/e6db4022-3765-4f13-a2e3-dcb5345cc518">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]