-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify log messages in controller package #2639
Clarify log messages in controller package #2639
Conversation
/assign @aledbf |
/approve |
/hold |
/hold cancel |
Codecov Report
@@ Coverage Diff @@
## master #2639 +/- ##
==========================================
+ Coverage 40.72% 40.83% +0.11%
==========================================
Files 75 75
Lines 5120 5123 +3
==========================================
+ Hits 2085 2092 +7
+ Misses 2753 2750 -3
+ Partials 282 281 -1
Continue to review full report at Codecov.
|
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, antoineco The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -116,8 +114,7 @@ func NewNGINXController(config *Configuration, fs file.Filesystem) *NGINXControl | |||
|
|||
fileSystem: fs, | |||
|
|||
// create an empty configuration. | |||
runningConfig: &ingress.Configuration{}, | |||
runningConfig: new(ingress.Configuration), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is new
a more (in comparison to &
) standard way of initializing objects in Go? Is it doing something different than &
in this specific case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new
is pretty much equivalent to &Type{}
, it allocates memory for the given Type. I like to use it for initializing zero values, but it's mostly sugar.
love these changes! |
What this PR does / why we need it:
This is an attempt to clarify most messages logged by the
controller
package and add details when I felt it was necessary (eg. what object a given message is related to, or why do we default to a particular value)I also took the liberty of rephrasing some methods documentation as I went through the code, and to remove comments where the logic is self-explanatory.
See #2368 (comment)
Cherry-picked examples: