Skip to content

Conversation

@openshift-cherrypick-robot

This is an automated cherry-pick of #1263

/assign abhinavdahiya

controller runtime currently defaults to NullLogger [1] which doesn't log anything.
This is bad because any error returned from Reconcile function is therefore not logged anywhere
which is same as just eating the error. To make sure the controller runtime errors are also logged
we would need an adapter for logrus as this project uses that for logging.

Therefore, this implements a wrapper around lorgus that satisfies the logr.Logger interface and
confure the hive-controller and hive-operator managers with it.

The wrapper uses logrus.DebugLevel for all info messages and logrus.ErrorLevel for all error messages
from controller-runtime regardless of level (V) selected by caller in controller-runtime. This makes
sure all error messages from controller-runtime are always visible and the rest are only visible when in
debug mode.

[1]: https://github.com/kubernetes-sigs/controller-runtime/blob/9e78e653228851684b6b9cdabe5aae8559fe3722/pkg/log/null.go#L28
@app-sre-bot
Copy link

Can one of the admins verify this patch?

@suhanime
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 28, 2021
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: openshift-cherrypick-robot, suhanime

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 28, 2021
@gregsheremeta
Copy link
Contributor

gregsheremeta commented Jan 28, 2021

/hold

@chrisahl or you ok with this logging fix cherry-pick to 2.2?

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 28, 2021
@chrisahl
Copy link

@gregsheremeta What is the risk and benefit of this fix?

@dgoodwin
Copy link
Contributor

This fix eliminates the possibility of an error getting silently dropped because the hive code explicitly forgot to log it, something we think might be going on with the cluster pool bug reported by ACM, and I believe this was the driver for backporting in the hopes we could get some more info. https://issues.redhat.com/browse/HIVE-1343

Risk should be exceedingly low.

@dgoodwin
Copy link
Contributor

/retest

@chrisahl
Copy link

Sounds like it should go in.

@gregsheremeta
Copy link
Contributor

/unhold
@chrisahl acked it

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 29, 2021
@openshift-merge-robot openshift-merge-robot merged commit 788199f into openshift:ocm-2.2 Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants