Skip to content

add -detach flag for 'ctr t start'#2582

Merged
estesp merged 1 commit intocontainerd:masterfrom
lifubang:startd
Aug 27, 2018
Merged

add -detach flag for 'ctr t start'#2582
estesp merged 1 commit intocontainerd:masterfrom
lifubang:startd

Conversation

@lifubang
Copy link
Copy Markdown
Contributor

@lifubang lifubang commented Aug 27, 2018

Signed-off-by: Lifubang [email protected]

While 'ctr run' has '-detach' flag.
But if I use 'ctr c create' create a container, there were no '-detach' flage to start the container.

Command history:

bin/ctr c create -t --rootfs /opt/runctest/redis/rootfs redis /usr/local/bin/redis-server /etc/redis.conf

bin/ctr t start -h
NAME:
   ctr tasks start - start a container that have been created

USAGE:
   ctr tasks start [command options] CONTAINER

OPTIONS:
   --null-io         send all IO to /dev/null
   --fifo-dir value  directory used for storing IO FIFOs
   --pid-file value  file path to write the task's pid

After this pr:

bin/ctr t start -h
NAME:
   ctr tasks start - start a container that have been created

USAGE:
   ctr tasks start [command options] CONTAINER

OPTIONS:
   --null-io         send all IO to /dev/null
   --fifo-dir value  directory used for storing IO FIFOs
   --pid-file value  file path to write the task's pid
   --detach, -d      detach from the task after it has started execution

bin/ctr t start -d redis
1:C 27 Aug 10:48:30.661 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
...........................
bin/ctr t ls
TASK     PID      STATUS    
redis    32604    RUNNING

The code is from 'cmd/ctr/commands/run/run.go'.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Aug 27, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2582   +/-   ##
=======================================
  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...66f6dd8. Read the comment docs.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

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

@estesp estesp merged commit 68a5db6 into containerd:master Aug 27, 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