-
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
fix path in file changed detected message #11271
Conversation
Signed-off-by: Tom Hayward <[email protected]>
Hi @kd7lxl. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
@@ -202,8 +202,9 @@ func NewNGINXController(config *Configuration, mc metric.Collector) *NGINXContro | |||
} | |||
|
|||
for _, f := range filesToWatch { | |||
f := f |
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.
Based on the fact that it took me some time to understand the root cause and the fix, I'd recommend adding a few lines of docs here. That's probably an easy one for devs deeper into that project and Go in general, but others might drop or refactor that line without further context. Maybe also reference this PR in your comment. Thank you!
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.
Added a link to a doc in the PR description.
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.
Sure, but nobody will find that if they are not git blame
ing and walking through history. So please add some words next to your code addition. 🙂
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.
Added a description of the code to the code.
/triage accepted |
/ok-to-test |
/cherry-pick release-1.10 |
@Gacko: once the present PR merges, I will cherry-pick it on top of release-1.10 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -202,8 +202,9 @@ func NewNGINXController(config *Configuration, mc metric.Collector) *NGINXContro | |||
} | |||
|
|||
for _, f := range filesToWatch { | |||
f := f |
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.
Sure, but nobody will find that if they are not git blame
ing and walking through history. So please add some words next to your code addition. 🙂
/hold According to the docs you added, this is already fixed in Go 1.22, so there's no change needed. Have you checked that bug against recent controller releases? They should be based on Go 1.22. |
... ok, nevermind. I mixed things up, we are on Go 1.21. |
Yes, it was tested against the latest release which is on go1.21. |
Was mistaking that because of this: https://github.com/kubernetes/ingress-nginx/blob/main/GOLANG_VERSION /unhold |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Gacko, kd7lxl 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 |
@Gacko: new pull request created: #11286 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What this PR does / why we need it:
This log would always print the path of the last file in the list, because
f
was modified by the for loop after the func was created. Fixed it so that now it prints the name of the file that was modified, which I believe was the original intention.This is one of the classic mistakes in Go, so much so that they changed the language behavior in go1.22 to prevent it: https://go.dev/blog/loopvar-preview
Also fixed spelling in the log message.
Types of changes
Which issue/s this PR fixes
How Has This Been Tested?
I haven't tested it.
Checklist: