-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Refactor config writing #419
Refactor config writing #419
Conversation
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.
Thanks for the PR. I left a few suggestions.
Also, could you possibly use createFileAndWrite
in https://github.com/nginxinc/kubernetes-ingress/blob/baf72e2c59107a019e1c3a7a3a62f9fff6163a1e/internal/nginx/nginx.go#L230 ?
internal/nginx/nginx.go
Outdated
if err != nil { | ||
glog.Fatalf("Failed to open %v: %v", filename, err) | ||
glog.Fatalf("%v", err.Error()) |
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.
It is better to add more context to the log message:
glog.Fatalf("Failed to write NGINX conf: %v", err)
Additionally, I don't see why we need to use err.Error())
instead of just err
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.
@pleshakov ok I will modify in accordance with you suggest
internal/nginx/nginx.go
Outdated
if err != nil { | ||
glog.Fatalf("Failed to open %v: %v", filename, err) | ||
glog.Fatalf("%v", err.Error()) |
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.
Similar to the main NGINX conf, better to add more context to the error message: "Failed to write version config: %v"
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.
Thanks for addressing the suggestions!
Could you possibly address 2 additional suggestions and then rebase against the master?
@pleshakov modify and rebase done, but I not sure rebase is right, pls check |
cb3323f
to
c2953ce
Compare
@feifeiiiiiiiiiii looks good, thank you! the rebase went well Please squash your commits into a single one rebasing one more time, and we'd be happy merge it. |
@pleshakov squash commits into a single commit has done, pls check |
c2953ce
to
f6bc379
Compare
Signed-off-by: qinpengfei <[email protected]> refactor func AddOrUpdateDHParam && add more context to log message Signed-off-by: qinpengfei <[email protected]> remove unnecessary log Signed-off-by: qinpengfei <[email protected]> fix log message Co-Authored-By: feifeiiiiiiiiiii <[email protected]> fix log message Co-Authored-By: feifeiiiiiiiiiii <[email protected]>
f6bc379
to
8da1b31
Compare
Signed-off-by: qinpengfei [email protected]
Proposed changes
Refactor write file code, reduce redundant code
Checklist
Before creating a PR, run through this checklist and mark each as complete.