-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reconcilers: Add an initial concept of a dedicated reconcilers object in mediator #872
Conversation
0543a9d
to
b6e564c
Compare
@jhrozek you mentioned you had some comments. |
… in mediator This creates a reconcilers object whose purpose is to persist the entities when needed and call for policy evaluation if required. The intent is to add further functionality here so we could do gradual or scheduled reconciles of objects.
This uses the passthrough builtin ingestor and a simple rego rule that always passes.
3ece65e
to
ced60e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great!
I added two comments because if I didn't add any it would look as if I acked a large PR without reading it :-) but please go ahead and merge now.
return nil, fmt.Errorf("error generating UUID: %w", err) | ||
} | ||
|
||
msg := message.NewMessage(id.String(), nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit: should we return nil, err
rather than empty_msg, err
on error? (I know that the caller should just not touch the first return parameter on error..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WithProvider(ectx.Provider). | ||
WithGroupID(ectx.Group.ID). | ||
WithRepository(repo). | ||
WithRepositoryID(dbrepo.ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since all handlers are now building entityInfoWrapper, then calling buildMessage and then publish using the same topic for all the publishers now, maybe another refactor might be to have a closure that would just return the entityInfoWrapper and then a shared code would build the message and publish it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates a reconcilers object whose purpose is to persist the entities when
needed and call for policy evaluation if required. The intent is to add
further functionality here so we could do gradual or scheduled reconciles of objects.
This also adds a unit test for the executor!