{"action":"created","comment":{"url":"https://api.github.com/repos/dcos/dcos/pulls/comments/93731696","pull_request_review_id":14265043,"id":93731696,"diff_hunk":"@@ -0,0 +1,36 @@\n+import uuid\n+\n+import pytest\n+\n+\n+@pytest.fixture(scope='module')\n+def auth_cluster(cluster):\n+    if not cluster.dockercfg_hook_enabled:\n+        pytest.skip(\"Skipped because not running against cluster with remove .dockercfg hook.\")\n+    return cluster\n+\n+\n+def test_remove_dockercfg_hook(cluster):","path":"packages/dcos-integration-test/extra/test_remove_dockercfg_hook.py","position":13,"original_position":13,"commit_id":"c60740afc746966a912c2a463d8515e1a69678be","original_commit_id":"c60740afc746966a912c2a463d8515e1a69678be","user":{"login":"adam-mesos","id":6456528,"avatar_url":"https://avatars.githubusercontent.com/u/6456528?v=3","gravatar_id":"","url":"https://api.github.com/users/adam-mesos","html_url":"https://github.com/adam-mesos","followers_url":"https://api.github.com/users/adam-mesos/followers","following_url":"https://api.github.com/users/adam-mesos/following{/other_user}","gists_url":"https://api.github.com/users/adam-mesos/gists{/gist_id}","starred_url":"https://api.github.com/users/adam-mesos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adam-mesos/subscriptions","organizations_url":"https://api.github.com/users/adam-mesos/orgs","repos_url":"https://api.github.com/users/adam-mesos/repos","events_url":"https://api.github.com/users/adam-mesos/events{/privacy}","received_events_url":"https://api.github.com/users/adam-mesos/received_events","type":"User","site_admin":false},"body":"This test is supposed to verify that the dockercfg is not exposed inside of the container, when using the fetcher to inject dockercfg's for talking to private registries. We added a special hook to remove the dockercfg from the sandbox before the container starts. Here's the intended flow of this test:\r\n1. On setup, drop a `.dockercfg` on every node's filesystem, in particular targeting the agents. This could just as well be fetched from an http/ftp URL.\r\n2. Metronome asks Mesos to launch a task with the dockercfg's URI as a fetcher artifact\r\n3. Mesos fetcher copies the dockercfg from the `file://` location into the sandbox prepared for the task\r\n4. If this task was a docker image (which it's not), the container runtime (UCR or Docker) would use the dockercfg's credentials to pull the image, e.g. from a private registry\r\n5. Then the hook swoops in and deletes the dockercfg from the sandbox directory (although it still lives in the original location from whence it was fetched)\r\n6. Then the container is launched and the task is run, which checks for the existence of the dockercfg file in the task's sandbox. The task is gone, so `test -f` returns a non-zero status code, which `metronome_one_off`'s `wait_for_completion` will detect as a failure, and raise an exception. I'm not sure why it doesn't. Maybe because we're never enabling the hook?\r\nI think the job should actually `test ! -f` as was happening before, and we should set `DOCKERCFG_HOOK=true` in at least one CI installer configuration\r\nI'll clean this up a bit and see if I can make it clearer in #1091 \r\n\r\nBonus points:\r\n- Verify that a fetched file of a different name is not removed.\r\nDouble-bonus points:\r\n- Use the .dockercfg to actually fetch an image from a private registry. Do we have any integration tests that use a private docker registry?","created_at":"2016-12-23T05:38:30Z","updated_at":"2016-12-23T05:38:30Z","html_url":"https://github.com/dcos/dcos/pull/713#discussion_r93731696","pull_request_url":"https://api.github.com/repos/dcos/dcos/pulls/713","_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos/pulls/comments/93731696"},"html":{"href":"https://github.com/dcos/dcos/pull/713#discussion_r93731696"},"pull_request":{"href":"https://api.github.com/repos/dcos/dcos/pulls/713"}}},"pull_request":{"url":"https://api.github.com/repos/dcos/dcos/pulls/713","id":85058433,"html_url":"https://github.com/dcos/dcos/pull/713","diff_url":"https://github.com/dcos/dcos/pull/713.diff","patch_url":"https://github.com/dcos/dcos/pull/713.patch","issue_url":"https://api.github.com/repos/dcos/dcos/issues/713","number":713,"state":"open","locked":false,"title":"WIP: dockercfg remove integration test","user":{"login":"joerg84","id":10809446,"avatar_url":"https://avatars.githubusercontent.com/u/10809446?v=3","gravatar_id":"","url":"https://api.github.com/users/joerg84","html_url":"https://github.com/joerg84","followers_url":"https://api.github.com/users/joerg84/followers","following_url":"https://api.github.com/users/joerg84/following{/other_user}","gists_url":"https://api.github.com/users/joerg84/gists{/gist_id}","starred_url":"https://api.github.com/users/joerg84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joerg84/subscriptions","organizations_url":"https://api.github.com/users/joerg84/orgs","repos_url":"https://api.github.com/users/joerg84/repos","events_url":"https://api.github.com/users/joerg84/events{/privacy}","received_events_url":"https://api.github.com/users/joerg84/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-13T14:25:26Z","updated_at":"2016-12-23T05:38:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"887a84af6d8ad79bc7491173bafb5e1cc6ce694c","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dcos/dcos/milestones/5","html_url":"https://github.com/dcos/dcos/milestone/5","labels_url":"https://api.github.com/repos/dcos/dcos/milestones/5/labels","id":1970672,"number":5,"title":"1.9","description":"Targeted for DC/OS 1.9","creator":{"login":"cmaloney","id":751088,"avatar_url":"https://avatars.githubusercontent.com/u/751088?v=3","gravatar_id":"","url":"https://api.github.com/users/cmaloney","html_url":"https://github.com/cmaloney","followers_url":"https://api.github.com/users/cmaloney/followers","following_url":"https://api.github.com/users/cmaloney/following{/other_user}","gists_url":"https://api.github.com/users/cmaloney/gists{/gist_id}","starred_url":"https://api.github.com/users/cmaloney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmaloney/subscriptions","organizations_url":"https://api.github.com/users/cmaloney/orgs","repos_url":"https://api.github.com/users/cmaloney/repos","events_url":"https://api.github.com/users/cmaloney/events{/privacy}","received_events_url":"https://api.github.com/users/cmaloney/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":44,"state":"open","created_at":"2016-08-29T20:17:07Z","updated_at":"2016-12-22T15:05:25Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/dcos/dcos/pulls/713/commits","review_comments_url":"https://api.github.com/repos/dcos/dcos/pulls/713/comments","review_comment_url":"https://api.github.com/repos/dcos/dcos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dcos/dcos/issues/713/comments","statuses_url":"https://api.github.com/repos/dcos/dcos/statuses/c60740afc746966a912c2a463d8515e1a69678be","head":{"label":"joerg84:docker_rm_intergration_test","ref":"docker_rm_intergration_test","sha":"c60740afc746966a912c2a463d8515e1a69678be","user":{"login":"joerg84","id":10809446,"avatar_url":"https://avatars.githubusercontent.com/u/10809446?v=3","gravatar_id":"","url":"https://api.github.com/users/joerg84","html_url":"https://github.com/joerg84","followers_url":"https://api.github.com/users/joerg84/followers","following_url":"https://api.github.com/users/joerg84/following{/other_user}","gists_url":"https://api.github.com/users/joerg84/gists{/gist_id}","starred_url":"https://api.github.com/users/joerg84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joerg84/subscriptions","organizations_url":"https://api.github.com/users/joerg84/orgs","repos_url":"https://api.github.com/users/joerg84/repos","events_url":"https://api.github.com/users/joerg84/events{/privacy}","received_events_url":"https://api.github.com/users/joerg84/received_events","type":"User","site_admin":false},"repo":{"id":63958623,"name":"dcos","full_name":"joerg84/dcos","owner":{"login":"joerg84","id":10809446,"avatar_url":"https://avatars.githubusercontent.com/u/10809446?v=3","gravatar_id":"","url":"https://api.github.com/users/joerg84","html_url":"https://github.com/joerg84","followers_url":"https://api.github.com/users/joerg84/followers","following_url":"https://api.github.com/users/joerg84/following{/other_user}","gists_url":"https://api.github.com/users/joerg84/gists{/gist_id}","starred_url":"https://api.github.com/users/joerg84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joerg84/subscriptions","organizations_url":"https://api.github.com/users/joerg84/orgs","repos_url":"https://api.github.com/users/joerg84/repos","events_url":"https://api.github.com/users/joerg84/events{/privacy}","received_events_url":"https://api.github.com/users/joerg84/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joerg84/dcos","description":"DC/OS Build and Release tools","fork":true,"url":"https://api.github.com/repos/joerg84/dcos","forks_url":"https://api.github.com/repos/joerg84/dcos/forks","keys_url":"https://api.github.com/repos/joerg84/dcos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joerg84/dcos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joerg84/dcos/teams","hooks_url":"https://api.github.com/repos/joerg84/dcos/hooks","issue_events_url":"https://api.github.com/repos/joerg84/dcos/issues/events{/number}","events_url":"https://api.github.com/repos/joerg84/dcos/events","assignees_url":"https://api.github.com/repos/joerg84/dcos/assignees{/user}","branches_url":"https://api.github.com/repos/joerg84/dcos/branches{/branch}","tags_url":"https://api.github.com/repos/joerg84/dcos/tags","blobs_url":"https://api.github.com/repos/joerg84/dcos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joerg84/dcos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joerg84/dcos/git/refs{/sha}","trees_url":"https://api.github.com/repos/joerg84/dcos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joerg84/dcos/statuses/{sha}","languages_url":"https://api.github.com/repos/joerg84/dcos/languages","stargazers_url":"https://api.github.com/repos/joerg84/dcos/stargazers","contributors_url":"https://api.github.com/repos/joerg84/dcos/contributors","subscribers_url":"https://api.github.com/repos/joerg84/dcos/subscribers","subscription_url":"https://api.github.com/repos/joerg84/dcos/subscription","commits_url":"https://api.github.com/repos/joerg84/dcos/commits{/sha}","git_commits_url":"https://api.github.com/repos/joerg84/dcos/git/commits{/sha}","comments_url":"https://api.github.com/repos/joerg84/dcos/comments{/number}","issue_comment_url":"https://api.github.com/repos/joerg84/dcos/issues/comments{/number}","contents_url":"https://api.github.com/repos/joerg84/dcos/contents/{+path}","compare_url":"https://api.github.com/repos/joerg84/dcos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joerg84/dcos/merges","archive_url":"https://api.github.com/repos/joerg84/dcos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joerg84/dcos/downloads","issues_url":"https://api.github.com/repos/joerg84/dcos/issues{/number}","pulls_url":"https://api.github.com/repos/joerg84/dcos/pulls{/number}","milestones_url":"https://api.github.com/repos/joerg84/dcos/milestones{/number}","notifications_url":"https://api.github.com/repos/joerg84/dcos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joerg84/dcos/labels{/name}","releases_url":"https://api.github.com/repos/joerg84/dcos/releases{/id}","deployments_url":"https://api.github.com/repos/joerg84/dcos/deployments","created_at":"2016-07-22T14:14:36Z","updated_at":"2016-07-22T14:14:38Z","pushed_at":"2016-09-15T21:22:36Z","git_url":"git://github.com/joerg84/dcos.git","ssh_url":"git@github.com:joerg84/dcos.git","clone_url":"https://github.com/joerg84/dcos.git","svn_url":"https://github.com/joerg84/dcos","homepage":"https://dcos.io","size":1670,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dcos:master","ref":"master","sha":"283456582fce9e1d8bab9ea9cd8642d54ae7191b","user":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"repo":{"id":56184050,"name":"dcos","full_name":"dcos/dcos","owner":{"login":"dcos","id":17648048,"avatar_url":"https://avatars.githubusercontent.com/u/17648048?v=3","gravatar_id":"","url":"https://api.github.com/users/dcos","html_url":"https://github.com/dcos","followers_url":"https://api.github.com/users/dcos/followers","following_url":"https://api.github.com/users/dcos/following{/other_user}","gists_url":"https://api.github.com/users/dcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcos/subscriptions","organizations_url":"https://api.github.com/users/dcos/orgs","repos_url":"https://api.github.com/users/dcos/repos","events_url":"https://api.github.com/users/dcos/events{/privacy}","received_events_url":"https://api.github.com/users/dcos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcos/dcos","description":"DC/OS Build and Release tools","fork":false,"url":"https://api.github.com/repos/dcos/dcos","forks_url":"https://api.github.com/repos/dcos/dcos/forks","keys_url":"https://api.github.com/repos/dcos/dcos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcos/dcos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcos/dcos/teams","hooks_url":"https://api.github.com/repos/dcos/dcos/hooks","issue_events_url":"https://api.github.com/repos/dcos/dcos/issues/events{/number}","events_url":"https://api.github.com/repos/dcos/dcos/events","assignees_url":"https://api.github.com/repos/dcos/dcos/assignees{/user}","branches_url":"https://api.github.com/repos/dcos/dcos/branches{/branch}","tags_url":"https://api.github.com/repos/dcos/dcos/tags","blobs_url":"https://api.github.com/repos/dcos/dcos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcos/dcos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcos/dcos/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcos/dcos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcos/dcos/statuses/{sha}","languages_url":"https://api.github.com/repos/dcos/dcos/languages","stargazers_url":"https://api.github.com/repos/dcos/dcos/stargazers","contributors_url":"https://api.github.com/repos/dcos/dcos/contributors","subscribers_url":"https://api.github.com/repos/dcos/dcos/subscribers","subscription_url":"https://api.github.com/repos/dcos/dcos/subscription","commits_url":"https://api.github.com/repos/dcos/dcos/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcos/dcos/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcos/dcos/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcos/dcos/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcos/dcos/contents/{+path}","compare_url":"https://api.github.com/repos/dcos/dcos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcos/dcos/merges","archive_url":"https://api.github.com/repos/dcos/dcos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcos/dcos/downloads","issues_url":"https://api.github.com/repos/dcos/dcos/issues{/number}","pulls_url":"https://api.github.com/repos/dcos/dcos/pulls{/number}","milestones_url":"https://api.github.com/repos/dcos/dcos/milestones{/number}","notifications_url":"https://api.github.com/repos/dcos/dcos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcos/dcos/labels{/name}","releases_url":"https://api.github.com/repos/dcos/dcos/releases{/id}","deployments_url":"https://api.github.com/repos/dcos/dcos/deployments","created_at":"2016-04-13T20:31:58Z","updated_at":"2016-12-22T20:23:48Z","pushed_at":"2016-12-23T02:33:13Z","git_url":"git://github.com/dcos/dcos.git","ssh_url":"git@github.com:dcos/dcos.git","clone_url":"https://github.com/dcos/dcos.git","svn_url":"https://github.com/dcos/dcos","homepage":"https://dcos.io","size":2495,"stargazers_count":1203,"watchers_count":1203,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":207,"mirror_url":null,"open_issues_count":37,"forks":207,"open_issues":37,"watchers":1203,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dcos/dcos/pulls/713"},"html":{"href":"https://github.com/dcos/dcos/pull/713"},"issue":{"href":"https://api.github.com/repos/dcos/dcos/issues/713"},"comments":{"href":"https://api.github.com/repos/dcos/dcos/issues/713/comments"},"review_comments":{"href":"https://api.github.com/repos/dcos/dcos/pulls/713/comments"},"review_comment":{"href":"https://api.github.com/repos/dcos/dcos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dcos/dcos/pulls/713/commits"},"statuses":{"href":"https://api.github.com/repos/dcos/dcos/statuses/c60740afc746966a912c2a463d8515e1a69678be"}}}}
{"actor":{"display_login":"adam-mesos"}}