{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/16638","labels_url":"https://api.github.com/repos/docker/docker/issues/16638/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/16638/comments","events_url":"https://api.github.com/repos/docker/docker/issues/16638/events","html_url":"https://github.com/docker/docker/pull/16638","id":108757108,"number":16638,"title":"refactor daemon image tagging","user":{"login":"MHBauer","id":13337345,"avatar_url":"https://avatars.githubusercontent.com/u/13337345?v=3","gravatar_id":"","url":"https://api.github.com/users/MHBauer","html_url":"https://github.com/MHBauer","followers_url":"https://api.github.com/users/MHBauer/followers","following_url":"https://api.github.com/users/MHBauer/following{/other_user}","gists_url":"https://api.github.com/users/MHBauer/gists{/gist_id}","starred_url":"https://api.github.com/users/MHBauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MHBauer/subscriptions","organizations_url":"https://api.github.com/users/MHBauer/orgs","repos_url":"https://api.github.com/users/MHBauer/repos","events_url":"https://api.github.com/users/MHBauer/events{/privacy}","received_events_url":"https://api.github.com/users/MHBauer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/dco/no","name":"dco/no","color":"f7c6c7"},{"url":"https://api.github.com/repos/docker/docker/labels/group/distribution","name":"group/distribution","color":"F6FBFF"},{"url":"https://api.github.com/repos/docker/docker/labels/status/1-design-review","name":"status/1-design-review","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-28T22:10:50Z","updated_at":"2015-09-30T18:17:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/16638","html_url":"https://github.com/docker/docker/pull/16638","diff_url":"https://github.com/docker/docker/pull/16638.diff","patch_url":"https://github.com/docker/docker/pull/16638.patch"},"body":"Using this PR to start discussion.\r\n\r\ndaemon exposes directly it's internal `repositories` member, which is a `*graph.TagStore`. Any external caller then needs to be able to import the docker/graph package. Most of these functions return only an error. The docker/image/Image struct will need to be moved into the api at some point in the future. graph.ImagePullConfig needs to move as well.\r\n\r\nIf this looks okay in principle, I would then do something similar for all of the remaining `daemon.Repositories().XYZ` calls.\r\n\r\nHere is a list of what remains:\r\n```\r\nλ ag '\\.Repositories\\(\\)'\r\napi/server/image.go\r\n115:\t\terr = s.daemon.Repositories().Pull(ctx, image, tag, imagePullConfig)\r\n132:\t\terr = s.daemon.Repositories().Import(ctx, src, repo, tag, message, r.Body, output, newConfig)\r\n187:\tif err := s.daemon.Repositories().Push(ctx, name, imagePushConfig); err != nil {\r\n215:\tif err := s.daemon.Repositories().ImageExport(names, output); err != nil {\r\n226:\treturn s.daemon.Repositories().Load(r.Body, w)\r\n259:\timageInspect, err := s.daemon.Repositories().Lookup(vars[\"name\"])\r\n367:\timages, err := s.daemon.Repositories().Images(r.Form.Get(\"filters\"), r.Form.Get(\"filter\"), boolValue(r, \"all\"))\r\n381:\thistory, err := s.daemon.Repositories().History(name)\r\n\r\nbuilder/dispatchers.go\r\n212:\timage, err := b.Daemon.Repositories().LookupImage(name)\r\n\r\nbuilder/internals.go\r\n519:\tif err := b.Daemon.Repositories().Pull(ctx, remote, tag, imagePullConfig); err != nil {\r\n523:\timage, err := b.Daemon.Repositories().LookupImage(name)\r\n\r\ndaemon/image_delete.go\r\n57:\timg, err := daemon.Repositories().LookupImage(imageRef)\r\n94:\t\trepoRefs := daemon.Repositories().ByID()[img.ID]\r\n120:\treturn len(daemon.Repositories().ByID()[imageID]) > 1\r\n149:\t_, err := daemon.Repositories().Delete(repository, ref)\r\n160:\timageRefs := daemon.Repositories().ByID()[imgID]\r\n312:\tif daemon.Repositories().HasReferences(img) {\r\n341:\treturn !(daemon.Repositories().HasReferences(img) || daemon.Graph().HasChildren(img))\r\n\r\ndaemon/list.go\r\n167:\t\t\timage, err := daemon.Repositories().LookupImage(ancestor)\r\n296:\timg, err := daemon.Repositories().LookupImage(container.Config.Image)\r\n``` "},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/144497053","html_url":"https://github.com/docker/docker/pull/16638#issuecomment-144497053","issue_url":"https://api.github.com/repos/docker/docker/issues/16638","id":144497053,"user":{"login":"MHBauer","id":13337345,"avatar_url":"https://avatars.githubusercontent.com/u/13337345?v=3","gravatar_id":"","url":"https://api.github.com/users/MHBauer","html_url":"https://github.com/MHBauer","followers_url":"https://api.github.com/users/MHBauer/followers","following_url":"https://api.github.com/users/MHBauer/following{/other_user}","gists_url":"https://api.github.com/users/MHBauer/gists{/gist_id}","starred_url":"https://api.github.com/users/MHBauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MHBauer/subscriptions","organizations_url":"https://api.github.com/users/MHBauer/orgs","repos_url":"https://api.github.com/users/MHBauer/repos","events_url":"https://api.github.com/users/MHBauer/events{/privacy}","received_events_url":"https://api.github.com/users/MHBauer/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T18:17:41Z","updated_at":"2015-09-30T18:17:41Z","body":"As I get down to the end, should I continue to remove all external references to daemon.Repositories() and then privatize it? Or do only the work necessary to cut the tie in api/ ?"}}