Skip to content

Commit

Permalink
⚠️ Fix broken kind logging (#1954)
Browse files Browse the repository at this point in the history
* Fix broken kind logging

If gvk.Kind is "APIService", I expect "apiService", but the current
code produces and logs "aPIService".  Because it is not easy to do
this kind of thing, it is better to log the kind as is.

* fixup! Fix broken kind logging
  • Loading branch information
tatsuhiro-t authored Jul 15, 2022
1 parent 15154aa commit b93b5f9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/builder/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,11 @@ func (blder *Builder) doController(r reconcile.Reconciler) error {
"controllerKind", gvk.Kind,
)

lowerCamelCaseKind := strings.ToLower(gvk.Kind[:1]) + gvk.Kind[1:]

ctrlOptions.LogConstructor = func(req *reconcile.Request) logr.Logger {
log := log
if req != nil {
log = log.WithValues(
lowerCamelCaseKind, klog.KRef(req.Namespace, req.Name),
gvk.Kind, klog.KRef(req.Namespace, req.Name),
"namespace", req.Namespace, "name", req.Name,
)
}
Expand Down

0 comments on commit b93b5f9

Please sign in to comment.