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

Print default plugin config. #2030

Merged

Conversation

Random-Liu
Copy link
Member

@Random-Liu Random-Liu commented Jan 19, 2018

Fixes #2027.

@containerd/containerd-maintainers Does this make sense to you?

The output:

$ containerd config default
root = "/var/lib/containerd"
state = "/run/containerd"
oom_score = 0

[grpc]
  address = "/run/containerd/containerd.sock"
  uid = 0
  gid = 0

[debug]
  address = "/run/containerd/debug.sock"
  uid = 0
  gid = 0
  level = "info"

[metrics]
  address = ""
  grpc_histogram = false

[cgroup]
  path = ""

[plugins]
  [plugins.cgroups]
    no_prometheus = false
  [plugins.diff]
    default = ["walking"]
  [plugins.linux]
    shim = "containerd-shim"
    runtime = "runc"
    runtime_root = ""
    no_shim = false
    shim_debug = false
  [plugins.scheduler]
    pause_threshold = 0.02
    deletion_threshold = 0
    mutation_threshold = 100
    schedule_delay = 0
    startup_delay = 100000000

Signed-off-by: Lantao Liu lantaol@google.com

@codecov-io
Copy link

codecov-io commented Jan 19, 2018

Codecov Report

Merging #2030 into master will decrease coverage by 4.58%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2030      +/-   ##
==========================================
- Coverage   50.17%   45.58%   -4.59%     
==========================================
  Files          84       94      +10     
  Lines        7342     9296    +1954     
==========================================
+ Hits         3684     4238     +554     
- Misses       2952     4348    +1396     
- Partials      706      710       +4
Flag Coverage Δ
#linux 50.21% <0%> (+0.04%) ⬆️
#windows 40.54% <0%> (?)
Impacted Files Coverage Δ
server/config.go 0% <ø> (ø) ⬆️
server/server.go 2.51% <0%> (-0.52%) ⬇️
fs/path.go 60.69% <0%> (-12.56%) ⬇️
snapshots/naive/naive.go 43.89% <0%> (-10%) ⬇️
metadata/snapshot.go 45.95% <0%> (-8.96%) ⬇️
archive/compression/compression.go 43.93% <0%> (-8.9%) ⬇️
remotes/docker/fetcher.go 41.42% <0%> (-7.6%) ⬇️
content/local/writer.go 52.63% <0%> (-7.37%) ⬇️
fs/copy.go 34.83% <0%> (-7.2%) ⬇️
archive/tar.go 43.51% <0%> (-6.94%) ⬇️
... and 59 more

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 823d339...3d6fe5a. Read the comment docs.

// WriteTo marshals the config to the provided writer
func (c *Config) WriteTo(w io.Writer) (int64, error) {
buf := bytes.NewBuffer(nil)
e := toml.NewEncoder(buf)
Copy link
Member

Choose a reason for hiding this comment

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

Why use a buffer here and not just w?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copied from original code. Will remove it then.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@Random-Liu
Copy link
Member Author

@crosbymichael Addressed comments.

@crosbymichael
Copy link
Member

LGTM

Signed-off-by: Lantao Liu <lantaol@google.com>
@Random-Liu
Copy link
Member Author

Fixed a vet error.

Copy link
Contributor

@mlaventure mlaventure left a comment

Choose a reason for hiding this comment

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

LGTM

@crosbymichael crosbymichael merged commit 4812f4b into containerd:master Jan 22, 2018
@Random-Liu Random-Liu deleted the print-plugin-default-config branch January 22, 2018 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants