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

fix: make stop stopped container return no error #1209

Merged
merged 1 commit into from
Apr 25, 2018

Conversation

allencloud
Copy link
Collaborator

Signed-off-by: Allen Sun [email protected]

Ⅰ. Describe what this PR did

make stop stopped container return no error.
This will be compatible with moby's API.

Ⅱ. Does this pull request fix one issue?

fxies #1207

Ⅲ. Describe how you did it

none

Ⅳ. Describe how to verify it

none

Ⅴ. Special notes for reviews

none

@pouchrobot pouchrobot added kind/bug This is bug report for project size/XS labels Apr 25, 2018
@codecov-io
Copy link

Codecov Report

Merging #1209 into master will increase coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1209      +/-   ##
==========================================
+ Coverage   15.57%   15.59%   +0.01%     
==========================================
  Files         178      178              
  Lines       10454    10441      -13     
==========================================
  Hits         1628     1628              
+ Misses       8706     8693      -13     
  Partials      120      120
Impacted Files Coverage Δ
daemon/mgr/container.go 0% <0%> (ø) ⬆️

@Letty5411
Copy link
Contributor

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Apr 25, 2018
@Letty5411 Letty5411 merged commit 3c308b9 into AliyunContainerService:master Apr 25, 2018
@@ -706,8 +706,9 @@ func (mgr *ContainerManager) Stop(ctx context.Context, name string, timeout int6
c.Lock()
defer c.Unlock()

if !c.IsRunning() {
return fmt.Errorf("container's status is not running: %s", c.meta.State.Status)
if c.IsStopped() {
Copy link
Contributor

Choose a reason for hiding this comment

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

create a new container, it's status is "created", actually, the container is stopped, but IsStopped() will return false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project LGTM one maintainer or community participant agrees to merge the pull reuqest. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants