Skip to content

Explore adding logging best-practices + logcheck to the Kubebuilder default scaffold or optional plugin for k8s conventions linter #5330

@camilamacedo86

Description

@camilamacedo86

Kubebuilder is used to build Kubernetes-native controllers, but logging guidance can be confusing for newcomers. Kubernetes logging conventions say log messages should start with a capital letter and not end with a period, while Go error strings should not be capitalised. This can lead to inconsistent logs in scaffolded projects.

Can we explore if Kubebuilder should:

  1. Document the recommended pattern clearly (log message style vs error string style),
  2. Ensure the default scaffold follows it,
  3. Consider enabling or recommending the logcheck linter.

Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/backlogHigher priority than priority/awaiting-more-evidence.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions