-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.priority/backlogHigher priority than priority/awaiting-more-evidence.Higher priority than priority/awaiting-more-evidence.
Description
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:
- Document the recommended pattern clearly (log message style vs error string style),
- Ensure the default scaffold follows it,
- Consider enabling or recommending the
logchecklinter.
Links:
- K8s logging message style: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#message-style-guidelines
- Go error strings: https://go.dev/wiki/CodeReviewComments#error-strings
- logcheck linter: https://github.com/kubernetes-sigs/logtools/tree/main/logcheck
mloskot
Metadata
Metadata
Assignees
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.priority/backlogHigher priority than priority/awaiting-more-evidence.Higher priority than priority/awaiting-more-evidence.