{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/24908","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/24908/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/24908/comments","events_url":"https://api.github.com/repos/docker/docker/issues/24908/events","html_url":"https://github.com/docker/docker/pull/24908","id":166909007,"number":24908,"title":"Treat HEALTHCHECK NONE the same as not setting a healthcheck","user":{"login":"jhorwit2","id":3876739,"avatar_url":"https://avatars.githubusercontent.com/u/3876739?v=3","gravatar_id":"","url":"https://api.github.com/users/jhorwit2","html_url":"https://github.com/jhorwit2","followers_url":"https://api.github.com/users/jhorwit2/followers","following_url":"https://api.github.com/users/jhorwit2/following{/other_user}","gists_url":"https://api.github.com/users/jhorwit2/gists{/gist_id}","starred_url":"https://api.github.com/users/jhorwit2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhorwit2/subscriptions","organizations_url":"https://api.github.com/users/jhorwit2/orgs","repos_url":"https://api.github.com/users/jhorwit2/repos","events_url":"https://api.github.com/users/jhorwit2/events{/privacy}","received_events_url":"https://api.github.com/users/jhorwit2/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/status/2-code-review","name":"status/2-code-review","color":"fad8c7"},{"url":"https://api.github.com/repos/docker/docker/labels/status/needs-vendoring","name":"status/needs-vendoring","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/53","html_url":"https://github.com/docker/docker/milestones/1.12.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/53/labels","id":1657301,"number":53,"title":"1.12.0","description":"feature/code freeze: June 14th, 2016","creator":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"open_issues":136,"closed_issues":756,"state":"open","created_at":"2016-03-21T13:47:53Z","updated_at":"2016-07-25T14:54:57Z","due_on":"2016-07-28T07:00:00Z","closed_at":null},"comments":9,"created_at":"2016-07-21T20:22:16Z","updated_at":"2016-07-25T15:17:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/24908","html_url":"https://github.com/docker/docker/pull/24908","diff_url":"https://github.com/docker/docker/pull/24908.diff","patch_url":"https://github.com/docker/docker/pull/24908.patch"},"body":"<!--\r\nPlease make sure you've read and understood our contributing guidelines;\r\nhttps://github.com/docker/docker/blob/master/CONTRIBUTING.md\r\n\r\n** Make sure all your commits include a signature generated with `git commit -s` **\r\n\r\nFor additional information on our contributing process, read our contributing\r\nguide https://docs.docker.com/opensource/code/\r\n\r\nIf this is a bug fix, make sure your description includes \"fixes #xxxx\", or\r\n\"closes #xxxx\"\r\n\r\nPlease provide the following information:\r\n-->\r\n\r\ncloses #24903\r\n\r\n**- What I did**\r\n\r\nTreat `HEALTHCHECK NONE` the same as not setting a healthcheck at all. Removed `no healthcheck` from Health string and means it's not showed in the `docker ps` output either. \r\n\r\n**- How I did it**\r\n\r\nIf there is no healthcheck probe then don't create/init health check monitoring. Before this PR docker would init the healthcheck monitor for a `HEALTHCHECK NONE` which resulted in the `State.Health.Status` value always being `starting` since it didn't have a probe to update in monitor goroutine. Now, when you set `HEALTHCHECK NONE` the `Health` struct will be nil just like it is when you don't set a healthcheck at all. \r\n\r\n**- How to verify it**\r\n\r\nCreate an image w/o a health check. \r\n\r\n```\r\necho 'FROM busybox\r\nHEALTHCHECK NONE\r\nCMD top' | docker build -t test_none -\r\n\r\ndocker run -d test_none\r\n```\r\n\r\nThen run `docker ps` and you shouldn't see `(no healthcheck)` in the status column. \r\n\r\n```\r\nCONTAINER ID        IMAGE               COMMAND             CREATED              STATUS                               PORTS               NAMES\r\n9767aa9caf61        test_none:latest    \"/bin/sh -c top\"    About a minute ago   Up About a minute (no healthcheck)                       test_none.1.04n8jw9670vzy3o5pc41wlqni\r\n```\r\n\r\nCreate another image with either a passing or failing healthcheck (one below fails). You still should see the transition from `starting` -> `unhealthy`. Before this PR it would show `no healthcheck` during the transition from failing the last check -> killing the container because of how the healthcheck was initialized. Now it will show `unhealthy` since the container is being killed. \r\n\r\n```\r\necho 'FROM busybox\r\nHEALTHCHECK --interval=5s --timeout=1s --retries=3 CMD ls /foo\r\nCMD top' | docker build -t test -\r\n\r\n$ docker service create --replicas 1 --name test test\r\n\r\n$ docker ps\r\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES\r\nf0d335cd81a2        test:latest         \"/bin/sh -c top\"    26 seconds ago      Up 25 seconds (unhealthy)                       test.1.axy6yvk16ximd3u6gib2sjb1t\r\nd77e1605440f        test_none           \"/bin/sh -c top\"    4 minutes ago       Up 4 minutes                                    grave_curran\r\n```\r\n\r\n**- Description for the changelog**\r\n<!--\r\nWrite a short (one line) summary that describes the changes in this\r\npull request for inclusion in the changelog:\r\n-->\r\n\r\nTreat HEALTHCHECK NONE the same as not setting a healthcheck. \r\n\r\nSigned-off-by: Josh Horwitz <horwitzja@gmail.com>"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/234984496","html_url":"https://github.com/docker/docker/pull/24908#issuecomment-234984496","issue_url":"https://api.github.com/repos/docker/docker/issues/24908","id":234984496,"user":{"login":"talex5","id":554131,"avatar_url":"https://avatars.githubusercontent.com/u/554131?v=3","gravatar_id":"","url":"https://api.github.com/users/talex5","html_url":"https://github.com/talex5","followers_url":"https://api.github.com/users/talex5/followers","following_url":"https://api.github.com/users/talex5/following{/other_user}","gists_url":"https://api.github.com/users/talex5/gists{/gist_id}","starred_url":"https://api.github.com/users/talex5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talex5/subscriptions","organizations_url":"https://api.github.com/users/talex5/orgs","repos_url":"https://api.github.com/users/talex5/repos","events_url":"https://api.github.com/users/talex5/events{/privacy}","received_events_url":"https://api.github.com/users/talex5/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T15:17:28Z","updated_at":"2016-07-25T15:17:28Z","body":"LGTM"}}
{"actor":{"display_login":"talex5"}}