Closed mojtaba-esk closed 4 days ago
[!WARNING]
Review failed
The pull request is closed.
The update involves a comprehensive refactoring across the codebase to enhance logging capabilities by replacing the global logrus
logger with custom logger instances passed through structs. This change improves modularity, composability, and control over logging across multiple packages, particularly focusing on Kubernetes-related functionalities.
Files/Group | Change Summary |
---|---|
pkg/builder/kaniko/kaniko_test.go |
Updated NewClientCustom call to include a new logger parameter. |
pkg/instance/destroy.go , helper.go , instance.go , pool.go |
Changed logrus logging statements to use i.Logger for the Instance struct. |
pkg/k8s/k8s.go |
Added a logger field to the Client struct and updated NewClient functions to accept a logger. |
pkg/k8s/k8s_custom_resource.go |
Replaced logrus with c.logger for logging in CreateCustomResource function. |
pkg/k8s/k8s_daemonset.go |
Replaced logrus with c.logger for logging in CreateDaemonSet , UpdateDaemonSet , and DeleteDaemonSet functions. |
pkg/k8s/k8s_networkpolicy.go |
Replaced logrus with c.logger for logging in NetworkPolicyExists function. |
pkg/k8s/k8s_pod.go |
Removed logrus import and updated Client struct methods to use c.logger for logging. |
pkg/k8s/k8s_pvc.go |
Replaced logrus with c.logger for logging in CreatePersistentVolumeClaim and DeletePersistentVolumeClaim functions. |
pkg/k8s/k8s_replicaset.go |
Converted prepareReplicaSet to a method of the Client struct and updated logging to use c.logger . |
pkg/k8s/k8s_service.go |
Replaced logrus with c.logger for logging service-related events. |
pkg/k8s/test_suite_test.go |
Added logrus.New() call in the SetupTest() function within the TestSuite struct. |
pkg/knuu/knuu.go |
Updated logging statements to use logger from Knuu struct and updated setDefaults function. |
Not applicable for these changes as the modifications are primarily about logging refactoring without significant control flow changes.
Objective (from #396) | Addressed | Explanation |
---|---|---|
Refactor packages to receive a logger object instead of using default logrus | ✅ |
In code where logs once prosperous grew, A rabbit hopped and knew what to do. With custom loggers bright, It set the codes alight, Bringing clarity to each debugging view.
🚀✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Closes #396
Summary by CodeRabbit
Refactor
logrus
.Chores
logrus
in favor of custom logger instances in multiple files.pkg/knuu/knuu.go
suggesting potential future changes for configuration functions.