{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/contrib/issues/1356","repository_url":"https://api.github.com/repos/kubernetes/contrib","labels_url":"https://api.github.com/repos/kubernetes/contrib/issues/1356/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/contrib/issues/1356/comments","events_url":"https://api.github.com/repos/kubernetes/contrib/issues/1356/events","html_url":"https://github.com/kubernetes/contrib/pull/1356","id":165153370,"number":1356,"title":"Atomic clone and updates for git-sync","user":{"login":"gregory-lyons","id":8563487,"avatar_url":"https://avatars.githubusercontent.com/u/8563487?v=3","gravatar_id":"","url":"https://api.github.com/users/gregory-lyons","html_url":"https://github.com/gregory-lyons","followers_url":"https://api.github.com/users/gregory-lyons/followers","following_url":"https://api.github.com/users/gregory-lyons/following{/other_user}","gists_url":"https://api.github.com/users/gregory-lyons/gists{/gist_id}","starred_url":"https://api.github.com/users/gregory-lyons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregory-lyons/subscriptions","organizations_url":"https://api.github.com/users/gregory-lyons/orgs","repos_url":"https://api.github.com/users/gregory-lyons/repos","events_url":"https://api.github.com/users/gregory-lyons/events{/privacy}","received_events_url":"https://api.github.com/users/gregory-lyons/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/contrib/labels/cla:%20no","name":"cla: no","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"mikedanese","id":1787169,"avatar_url":"https://avatars.githubusercontent.com/u/1787169?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedanese","html_url":"https://github.com/mikedanese","followers_url":"https://api.github.com/users/mikedanese/followers","following_url":"https://api.github.com/users/mikedanese/following{/other_user}","gists_url":"https://api.github.com/users/mikedanese/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedanese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedanese/subscriptions","organizations_url":"https://api.github.com/users/mikedanese/orgs","repos_url":"https://api.github.com/users/mikedanese/repos","events_url":"https://api.github.com/users/mikedanese/events{/privacy}","received_events_url":"https://api.github.com/users/mikedanese/received_events","type":"User","site_admin":false},"assignees":[{"login":"mikedanese","id":1787169,"avatar_url":"https://avatars.githubusercontent.com/u/1787169?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedanese","html_url":"https://github.com/mikedanese","followers_url":"https://api.github.com/users/mikedanese/followers","following_url":"https://api.github.com/users/mikedanese/following{/other_user}","gists_url":"https://api.github.com/users/mikedanese/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedanese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedanese/subscriptions","organizations_url":"https://api.github.com/users/mikedanese/orgs","repos_url":"https://api.github.com/users/mikedanese/repos","events_url":"https://api.github.com/users/mikedanese/events{/privacy}","received_events_url":"https://api.github.com/users/mikedanese/received_events","type":"User","site_admin":false}],"milestone":null,"comments":22,"created_at":"2016-07-12T18:55:16Z","updated_at":"2016-08-09T18:09:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/contrib/pulls/1356","html_url":"https://github.com/kubernetes/contrib/pull/1356","diff_url":"https://github.com/kubernetes/contrib/pull/1356.diff","patch_url":"https://github.com/kubernetes/contrib/pull/1356.patch"},"body":"The git-sync sidecar container pulls Git content into a shared volume, but another container may begin accessing the incomplete repository while the initial pull is occurring. There has been some discussion of the matter here: https://github.com/kubernetes/kubernetes/issues/17676.\r\n\r\nThis change provides the option to make the initial clone/pull atomic (i.e. the target directory will not appear in the filesystem until the pull is complete). I've included atomic.md as a readme with more information about usage and implementation, but can merge that into the existing README.md instead if that is preferred. \r\n\r\n@thockin @huggsboson"},"comment":{"url":"https://api.github.com/repos/kubernetes/contrib/issues/comments/238640096","html_url":"https://github.com/kubernetes/contrib/pull/1356#issuecomment-238640096","issue_url":"https://api.github.com/repos/kubernetes/contrib/issues/1356","id":238640096,"user":{"login":"gregory-lyons","id":8563487,"avatar_url":"https://avatars.githubusercontent.com/u/8563487?v=3","gravatar_id":"","url":"https://api.github.com/users/gregory-lyons","html_url":"https://github.com/gregory-lyons","followers_url":"https://api.github.com/users/gregory-lyons/followers","following_url":"https://api.github.com/users/gregory-lyons/following{/other_user}","gists_url":"https://api.github.com/users/gregory-lyons/gists{/gist_id}","starred_url":"https://api.github.com/users/gregory-lyons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregory-lyons/subscriptions","organizations_url":"https://api.github.com/users/gregory-lyons/orgs","repos_url":"https://api.github.com/users/gregory-lyons/repos","events_url":"https://api.github.com/users/gregory-lyons/events{/privacy}","received_events_url":"https://api.github.com/users/gregory-lyons/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T18:09:32Z","updated_at":"2016-08-09T18:09:32Z","body":"Took a stab at using git worktree in https://github.com/kubernetes/contrib/pull/1356/commits/88cfdeaddf3f0e5c27ae7025cb8b0fda7700cf26\r\n\r\nPseudocode is now:\r\n```\r\nif target repo does not exist\r\n        clone into /git/.git (no checkout)\r\nelse if target repo does not need update\r\n        return\r\nendif\r\ngit fetch origin <branch>\r\ngit worktree add /git/rev-<random-int> origin/<branch>\r\n(switch symlinks)\r\n(rm and prune old worktrees)\r\n```\r\n\r\nI used random int for the rev-.../ naming instead of $(date '+%y%m%d%H%M'), because depending on how frequently and quickly we are polling the repo, we could end up with a collision if basing the naming off timing.\r\n"}}
{"actor":{"display_login":"gregory-lyons"}}