-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
🐛 fix incorrect logr usage #193
Conversation
pkg/source/source.go
Outdated
@@ -86,8 +86,8 @@ func (ks *Kind) Start(handler handler.EventHandler, queue workqueue.RateLimiting | |||
i, err := ks.cache.GetInformer(ks.Type) | |||
if err != nil { | |||
if kindMatchErr, ok := err.(*meta.NoKindMatchError); ok { | |||
log.Error(err, "if %s is a CRD, should install it before calling Start", | |||
kindMatchErr.GroupKind) | |||
log.Error(err, fmt.Sprintf("if %s is a CRD, should install it before calling Start", |
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.
For better or for worse, this is specifically discouraged by logr. https://github.com/go-logr/logr/blob/9fb12b3b21c5415d16ac18dc5cd42c1cfdd40c4e/logr.go#L11
logr wants you to use structured logging.
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.
fixed, thanks.
a8a9007
to
efff64f
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.
nit around working, otherwise fine
pkg/source/source.go
Outdated
@@ -86,8 +86,8 @@ func (ks *Kind) Start(handler handler.EventHandler, queue workqueue.RateLimiting | |||
i, err := ks.cache.GetInformer(ks.Type) | |||
if err != nil { | |||
if kindMatchErr, ok := err.(*meta.NoKindMatchError); ok { | |||
log.Error(err, "if %s is a CRD, should install it before calling Start", | |||
kindMatchErr.GroupKind) | |||
log.Error(err, "Kind should be installed before calling Start", |
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.
please add the working back in as "if kind is a CRD, it should be installed before calling start"
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.
Fixed, thanks.
efff64f
to
d0f126b
Compare
/lgtm |
looks failed travis blocked this PR. |
/assign @DirectXMan12 |
@interma can you rebase on the latest master? there was a pr up to fix that flake |
d0f126b
to
c66fe39
Compare
Sure, rebased. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DirectXMan12, interma The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
🐛 fix incorrect logr usage
Update GitBook docs with warning about core-type scaffold tests failing
Fix: #187