Skip to content
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

Merged
merged 1 commit into from
Jun 13, 2018
Merged

Clarify log messages in controller package #2639

merged 1 commit into from
Jun 13, 2018

Conversation

antoineco
Copy link
Contributor

@antoineco antoineco commented Jun 13, 2018

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:

controller.go:922] Ingress "nginx/examples" defines both a backend and rules. Using backend as default upstream for all its rules.
controller.go:1002] Ingress "nginx/examples" does not contains a TLS section.
controller.go:461] Adding location "/foo1" for server "host1" with upstream "nginx-echoheaders2-http" (Ingress "nginx/examples")
controller.go:461] Adding location "/foo2" for server "host1" with upstream "nginx-echoheaders2-http" (Ingress "nginx/examples")
controller.go:209] Obtaining information about TCP stream services from ConfigMap "nginx/tcp-services"
controller.go:289] Searching Endpoints with TCP port name "http" for Service "nginx/echoheaders"

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 13, 2018
@antoineco
Copy link
Contributor Author

antoineco commented Jun 13, 2018

/assign @aledbf
/assign @ElvinEfendi

@aledbf
Copy link
Member

aledbf commented Jun 13, 2018

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 13, 2018
@antoineco
Copy link
Contributor Author

/hold
I need to adjust some E2E strings.

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 13, 2018
@antoineco
Copy link
Contributor Author

/hold cancel
done

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 13, 2018
@codecov-io
Copy link

codecov-io commented Jun 13, 2018

Codecov Report

Merging #2639 into master will increase coverage by 0.11%.
The diff coverage is 9.23%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
internal/ingress/controller/tcp.go 0% <0%> (ø) ⬆️
internal/ingress/controller/controller.go 2.21% <0%> (-0.02%) ⬇️
internal/ingress/controller/endpoints.go 94.23% <100%> (ø) ⬆️
internal/ingress/controller/nginx.go 11.26% <3.03%> (+0.02%) ⬆️
internal/ingress/controller/util.go 41.66% <50%> (ø) ⬆️
cmd/nginx/main.go 29% <0%> (+5.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf1f015...47bea35. Read the comment docs.

@aledbf
Copy link
Member

aledbf commented Jun 13, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 13, 2018
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 5046129 into kubernetes:master Jun 13, 2018
@antoineco antoineco deleted the feature/improve-controller-logs branch June 13, 2018 19:56
@@ -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),
Copy link
Member

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?

Copy link
Contributor Author

@antoineco antoineco Jun 18, 2018

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.

@ElvinEfendi
Copy link
Member

ElvinEfendi commented Jun 18, 2018

love these changes!

@antoineco antoineco mentioned this pull request Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants