{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/24755","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/24755/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/24755/comments","events_url":"https://api.github.com/repos/docker/docker/issues/24755/events","html_url":"https://github.com/docker/docker/pull/24755","id":166106210,"number":24755,"title":"update \"image delete\" error to match actual behavior","user":{"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},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/status/0-triage","name":"status/0-triage","color":"EEEEEE"},{"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/failing-ci","name":"status/failing-ci","color":"888888"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-18T14:25:51Z","updated_at":"2016-07-18T15:52:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/24755","html_url":"https://github.com/docker/docker/pull/24755","diff_url":"https://github.com/docker/docker/pull/24755.diff","patch_url":"https://github.com/docker/docker/pull/24755.patch"},"body":"The error message;\r\n\r\n    unable to delete .... (must be forced) - image is referenced in one or more repositories\r\n\r\nLooks to be incorrect\r\n\r\nGiven the following images:\r\n\r\n    docker images | grep 2d36b1c0ea40\r\n    registry                           2                                     2d36b1c0ea40        7 weeks ago         171.2 MB\r\n    registry                           2.4.1                                 2d36b1c0ea40        7 weeks ago         171.2 MB\r\n\r\nRemoving the image by *id* fails:\r\n\r\n    docker rmi 2d36b1c0ea40\r\n    Error response from daemon: conflict: unable to delete 2d36b1c0ea40 (must be forced) - image is referenced in one or more repositories\r\n\r\nHowever, after untagging one image:\r\n\r\n    docker rmi registry:2\r\n    Untagged: registry:2\r\n\r\nRemoving the image works:\r\n\r\n    docker rmi 2d36b1c0ea40\r\n    Untagged: registry:2.4.1\r\n    Deleted: sha256:2d36b1c0ea40159adc8b36f7563f1d7a6d443384fe2611e8b393c1cb3ae2e6ad\r\n    Deleted: sha256:7abfddbf4e61927307b6646010845eeb7513ecc6541f33ea6103b2493e36aa4e\r\n    Deleted: sha256:f512d7699dbb2994fe15d30ee1d404e57b58c3c310617b4471db649680b4cfa0\r\n    Deleted: sha256:7291e34714908270aeda93f1dc681485f9734d41314e2fdc6c11f32ffa782a21\r\n    Deleted: sha256:548f6562929484f3d78267e4b1e31dcfeb9f303059668888b4423ce5501c7fbc\r\n    Deleted: sha256:afe56b46629e6d8e0bfc36fed13395a7cfa2bd83b58bb489976ef13553eff20b\r\n    Deleted: sha256:cf0c3bd5d6a0a14ebf96cc7d3df79a37774a70f3086273e09da71a86fe74fec2\r\n    Deleted: sha256:c5fdaf8b055f544d0211043e687905315c3a0b71c1c08df07e473dd0a30e43c8\r\n\r\n    docker images | grep 2d36b1c0ea40\r\n    <empty>\r\n\r\nThis changes the error message to reflect that behavior\r\n\r\nThis also changes the comparison to check for `> 1` reference for clarity;\r\n\r\nThe `conflictActiveReference` bit is only unset\r\n(inside `ImageDelete()`) if there's just a single\r\nreference to the image;\r\n\r\n    if isSingleReference(repoRefs) {\r\n        c := conflictHard\r\n        if !force {\r\n            c |= conflictSoft &^ conflictActiveReference\r\n        }\r\n\r\nSo changing to `> 1` does not affect the actual flow, but makes it slightly more understandable.\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/233371133","html_url":"https://github.com/docker/docker/pull/24755#issuecomment-233371133","issue_url":"https://api.github.com/repos/docker/docker/issues/24755","id":233371133,"user":{"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},"created_at":"2016-07-18T15:52:45Z","updated_at":"2016-07-18T15:52:45Z","body":"hm, looks like this broke something? I'll need to look"}}
{"actor":{"display_login":"thaJeztah"}}