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

enhance: add more log for creating new objects #1450

Merged
merged 1 commit into from
Jun 3, 2018

Conversation

ZouRui89
Copy link
Contributor

@ZouRui89 ZouRui89 commented Jun 1, 2018

Signed-off-by: Zou Rui 21751189@zju.edu.cn

Ⅰ. Describe what this PR did

This pr adds more log on pouchd side. While creating a new container, network or volume, create args will be printed on pouchd log, which enables us to debug a possible creation failure on API side.

Infof() is adopted since we think it is better for production environment, than Debugf().

Ⅱ. Does this pull request fix one issue?

fixes #664

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

INFO[2018-06-01T07:45:48.197062353Z] Calling POST /v1.24/volumes/create, client @ 
INFO[2018-06-01T07:45:48.197302776Z] create volume with args: {"Driver":"local","DriverOpts":{"opt.size":"100g"},"Name":"pouch-volume"}
INFO[2018-06-01T07:46:52.219091382Z] Calling POST /v1.24/networks/create, client @ 
INFO[2018-06-01T07:46:52.219286598Z] create network with args: {"Name":"pouchnet","CheckDuplicate":true,"Driver":"bridge","IPAM":{"Config":[{"Gateway":"192.168.1.1","Subnet":"192.168.1.0/24"}],"Driver":"default"}} 
INFO[2018-06-01T07:48:13.014402291Z] Calling POST /v1.24/containers/create?name=foo, client @ 
INFO[2018-06-01T07:48:13.01545681Z] create container with args: {"Cmd":null,"Entrypoint":[],"Env":null,"Image":"docker.io/library/busybox:latest","OnBuild":null,"Shell":null,"HostConfig":{"NetworkMode":"bridge","OomScoreAdj":-500,"RestartPolicy":{"Name":"no"},"BlkioDeviceReadBps":null,"BlkioDeviceReadIOps":null,"BlkioDeviceWriteBps":null,"BlkioDeviceWriteIOps":null,"BlkioWeightDevice":null,"DeviceCgroupRules":null,"Devices":[],"MemoryExtra":0,"MemorySwappiness":-1,"MemoryWmarkRatio":0,"OomKillDisable":false,"Ulimits":null},"NetworkingConfig":{}} 

Ⅴ. Special notes for reviews

Thx for your hints! 😄 @shaloulcy

@allencloud
Copy link
Collaborator

Still no circle CI test case. Pity. 😿

@codecov-io
Copy link

codecov-io commented Jun 1, 2018

Codecov Report

Merging #1450 into master will increase coverage by 21.11%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1450       +/-   ##
===========================================
+ Coverage   16.46%   37.57%   +21.11%     
===========================================
  Files         202      253       +51     
  Lines       13591    17257     +3666     
===========================================
+ Hits         2238     6485     +4247     
+ Misses      11197     9950     -1247     
- Partials      156      822      +666
Impacted Files Coverage Δ
apis/server/network_bridge.go 63.63% <100%> (+63.63%) ⬆️
apis/server/volume_bridge.go 63.72% <100%> (+63.72%) ⬆️
apis/server/container_bridge.go 82.88% <100%> (+82.88%) ⬆️
apis/server/utils.go 64.28% <50%> (+64.28%) ⬆️
cri/v1alpha1/cri_utils.go 22.08% <0%> (-7.17%) ⬇️
cri/v1alpha2/cri_utils.go 21.39% <0%> (-6.96%) ⬇️
cli/container.go 0% <0%> (ø) ⬆️
cli/common_flags.go 0% <0%> (ø) ⬆️
main.go 60.13% <0%> (ø)
storage/controlserver/client/url.go 0% <0%> (ø)
... and 122 more

@ZouRui89
Copy link
Contributor Author

ZouRui89 commented Jun 1, 2018

It seems like they have not offered an email address. So I am still trying to figure out a way to contact them. 😭 @allencloud

@ZouRui89 ZouRui89 force-pushed the log_add branch 2 times, most recently from e433ff8 to 77c94c0 Compare June 1, 2018 14:26
Signed-off-by: Zou Rui <21751189@zju.edu.cn>
@allencloud
Copy link
Collaborator

LGTM. Thanks a lot for your work. It will bring lots of convenience for the debugging, @Letty5411 @rudyfly

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Jun 3, 2018
@allencloud allencloud merged commit d35b6b3 into AliyunContainerService:master Jun 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/log LGTM one maintainer or community participant agrees to merge the pull reuqest. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature required] print create args in pouch deamon log
4 participants