Skip to content
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

Add logs that allow users to see what events the controller is receiving #4779

Merged

Conversation

fabianvf
Copy link
Member

@fabianvf fabianvf commented Apr 16, 2021

Description of the change:
Adds event handlers that emit a log signaling what events are coming in and what primary resource it will map to.

This is currently just for the ansible-operator specifically, it may be that these changes are better suited to operator-lib or controller-runtime, but I wanted people to be able to work with a basic implementation before I started working on a more complete solution.

Motivation for the change:
For Ansible-based Operators specifically, we've frequently had issues with infinite reconciliation loops caused by controllers wrestling over a resource, but what resource is causing the issue is completely opaque to the user. This should make debugging those kinds of issues significantly easier.

Fixes #3945

Checklist

If the pull request includes user-facing changes, extra documentation is required:

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 16, 2021
@fabianvf fabianvf force-pushed the ansible-logging-event-handler branch 3 times, most recently from 9b7cd99 to 3e66b56 Compare April 26, 2021 20:38
Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
* Add prometheus/client_model dependency

Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
@fabianvf fabianvf force-pushed the ansible-logging-event-handler branch from 3e66b56 to 2f21571 Compare April 26, 2021 20:42
Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
@fabianvf fabianvf force-pushed the ansible-logging-event-handler branch from c556bbb to e0a54cf Compare April 27, 2021 16:19
@fabianvf fabianvf changed the title WIP: Add logs that allow users to see what events the controller is receiving Add logs that allow users to see what events the controller is receiving Apr 27, 2021
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 27, 2021
@estroz
Copy link
Member

estroz commented Apr 27, 2021

/assign

Co-authored-by: Eric Stroczynski <estroczy@redhat.com>
Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
@fabianvf fabianvf force-pushed the ansible-logging-event-handler branch from 13e2897 to cdd8834 Compare April 27, 2021 18:03
fabianvf and others added 2 commits April 27, 2021 14:45
Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>

Co-authored-by: Eric Stroczynski <estroczy@redhat.com>
Copy link
Member

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2021
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2021
Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. This may be a good candidate for operator-lib after a few releases.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2021
Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
@fabianvf fabianvf force-pushed the ansible-logging-event-handler branch from bee1354 to fce10d7 Compare April 27, 2021 21:48
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2021
@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@fabianvf fabianvf merged commit a90d89a into operator-framework:master Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

have some way to know what dependent resource was touched to trigger ansible operator reconciliation
4 participants