Skip to content

fix when --config provided, don't need Image/RootFS#2579

Merged
crosbymichael merged 2 commits intocontainerd:masterfrom
lifubang:ctrrun
Sep 10, 2018
Merged

fix when --config provided, don't need Image/RootFS#2579
crosbymichael merged 2 commits intocontainerd:masterfrom
lifubang:ctrrun

Conversation

@lifubang
Copy link
Copy Markdown
Contributor

Signed-off-by: Lifubang [email protected]

After Merged pull request #2544
When run a command:
ctr run --config ./config.json --rootfs ./rootfs redis
or
ctr run --config ./config.json docker.io/library/redis:latest redis

The param Image/RootFS will be ignored. It will make the user puzzled when Image/RootFS's value is different from root.path in config.json.

I think pr #2544 may be can improved with a different solution, or if you accept pr #2544, you need to consider this PR.
Please check it. Thanks.

After this PR, more improves will be achieved, such as: ctr run --help, ctr c create --help.

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #2579 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2579   +/-   ##
=======================================
  Coverage   44.59%   44.59%           
=======================================
  Files          95       95           
  Lines       10007    10007           
=======================================
  Hits         4463     4463           
  Misses       4822     4822           
  Partials      722      722
Flag Coverage Δ
#linux 48.4% <ø> (ø) ⬆️
#windows 41.54% <ø> (ø) ⬆️

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 d7dc384...1d9b969. Read the comment docs.

@lifubang
Copy link
Copy Markdown
Contributor Author

lifubang commented Sep 5, 2018

These two commands have the same effects.

ctr run --config ./config.json docker.io/library/redis:latest redis
ctr run -d --config ./config.json - redis

So I think Image/RootFS param is not required when --config is pass to ctr.

Comment thread cmd/ctr/commands/run/run_unix.go Outdated
id = context.Args().Get(1)
args = context.Args()[2:]
id string
Config = context.IsSet("config")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think Config should be capitalized

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your careful review.

Copy link
Copy Markdown
Contributor Author

@lifubang lifubang left a comment

Choose a reason for hiding this comment

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

Config -> config is finished.

Copy link
Copy Markdown
Member

@estesp estesp 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
Copy link
Copy Markdown
Member

LGTM

@crosbymichael crosbymichael merged commit 1597270 into containerd:master Sep 10, 2018
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