Skip to content

Commit

Permalink
Fix broken kind logging
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tatsuhiro-t committed Jul 13, 2022
1 parent 15154aa commit a02d631
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/builder/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,13 @@ func (blder *Builder) doController(r reconcile.Reconciler) error {
"controllerKind", gvk.Kind,
)

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

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

0 comments on commit a02d631

Please sign in to comment.