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

refactor: refact daemon log #2324

Merged
merged 1 commit into from
Oct 23, 2018
Merged

Conversation

rudyfly
Copy link
Collaborator

@rudyfly rudyfly commented Oct 18, 2018

Ⅰ. Describe what this PR did

Change the log level of all the "Get" method from "Info" to "Debug".
Add the log to show set the disk quota information.

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

NONE

Ⅳ. Describe how to verify it

NONE

Ⅴ. Special notes for reviews

Signed-off-by: Rudy Zhang [email protected]

@codecov
Copy link

codecov bot commented Oct 18, 2018

Codecov Report

Merging #2324 into master will decrease coverage by <.01%.
The diff coverage is 73.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2324      +/-   ##
==========================================
- Coverage   67.34%   67.33%   -0.01%     
==========================================
  Files         218      218              
  Lines       17674    17675       +1     
==========================================
- Hits        11902    11901       -1     
- Misses       4365     4366       +1     
- Partials     1407     1408       +1
Flag Coverage Δ
#criv1alpha1test 32.17% <30.76%> (-0.14%) ⬇️
#criv1alpha2test 36.2% <34.61%> (-0.05%) ⬇️
#integrationtest 40.4% <0%> (-0.07%) ⬇️
#nodee2etest 33.62% <38.46%> (+0.05%) ⬆️
#unittest 23.32% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
cri/v1alpha1/cri.go 60.38% <0%> (-0.33%) ⬇️
storage/quota/quota.go 49.47% <100%> (+0.26%) ⬆️
cri/v1alpha1/cri_wrapper.go 55.3% <66.66%> (ø) ⬆️
cri/v1alpha2/cri_wrapper.go 62.4% <83.33%> (+1.19%) ⬆️
ctrd/watch.go 78.78% <0%> (-4.55%) ⬇️
pkg/meta/store.go 62.5% <0%> (-1.57%) ⬇️
daemon/mgr/container_utils.go 82.82% <0%> (-1.23%) ⬇️
daemon/mgr/container.go 58.35% <0%> (-0.44%) ⬇️
cri/v1alpha2/cri.go 68.36% <0%> (+0.24%) ⬆️
... and 3 more

@@ -855,7 +855,7 @@ func (c *CriManager) ListContainerStats(ctx context.Context, r *runtime.ListCont
for _, container := range containers {
cs, err := c.getContainerMetrics(ctx, container)
if err != nil {
logrus.Errorf("failed to decode metrics of container %q: %v", container.ID, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decode metrics log level keep as Error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Change the log level of all the "Get" method from "Info" to "Debug".
Add the log to show set the disk quota information.

Signed-off-by: Rudy Zhang <[email protected]>
@starnop
Copy link
Contributor

starnop commented Oct 19, 2018

LGTM. expect the comments above. Just a little tip: ContainerStats will not be called by kubernetes automatically.

Copy link
Contributor

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fuweid fuweid merged commit fb0d5e3 into AliyunContainerService:master Oct 23, 2018
@@ -94,12 +94,12 @@ func (c *CriWrapper) RemovePodSandbox(ctx context.Context, r *runtime.RemovePodS

// PodSandboxStatus returns the status of the PodSandbox.
func (c *CriWrapper) PodSandboxStatus(ctx context.Context, r *runtime.PodSandboxStatusRequest) (res *runtime.PodSandboxStatusResponse, err error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So strange to see using a defer to cover a simple error asserting. 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants