{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/14618","repository_url":"https://api.github.com/repos/openshift/origin","labels_url":"https://api.github.com/repos/openshift/origin/issues/14618/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/14618/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/14618/events","html_url":"https://github.com/openshift/origin/pull/14618","id":235635189,"number":14618,"title":"Make dind-setup.sh invoke sudo as needed again","user":{"login":"danwinship","id":96040,"avatar_url":"https://avatars3.githubusercontent.com/u/96040?v=3","gravatar_id":"","url":"https://api.github.com/users/danwinship","html_url":"https://github.com/danwinship","followers_url":"https://api.github.com/users/danwinship/followers","following_url":"https://api.github.com/users/danwinship/following{/other_user}","gists_url":"https://api.github.com/users/danwinship/gists{/gist_id}","starred_url":"https://api.github.com/users/danwinship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danwinship/subscriptions","organizations_url":"https://api.github.com/users/danwinship/orgs","repos_url":"https://api.github.com/users/danwinship/repos","events_url":"https://api.github.com/users/danwinship/events{/privacy}","received_events_url":"https://api.github.com/users/danwinship/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-13T17:50:00Z","updated_at":"2017-06-13T17:57:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/14618","html_url":"https://github.com/openshift/origin/pull/14618","diff_url":"https://github.com/openshift/origin/pull/14618.diff","patch_url":"https://github.com/openshift/origin/pull/14618.patch"},"body":"dind-setup.sh had the feature that it would use sudo when invoking docker automatically, if needed. It still has code that figures out whether to use sudo or not, but it's now half-broken, because os::build::image doesn't care.\r\n\r\nThe patch currently attached to this PR attempts to tweak things to make os::build::image use sudo as needed, although another possibility would be to just get rid of the auto-sudo code in dind-setup.sh and require people to explicitly say \"sudo ./hack/dind-setup.sh\". (I'm not sure if there's some good reason to avoid running the whole script under sudo, like maybe it writes to some files that you want it to write to as you rather than as root? Oh, and actually, you probably have to say 'sudo env PATH=\"${PATH}\" ...' as in the patch here, because if you \"go get\"ted imagebuilder, it's probably not in root's path."},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/308198063","html_url":"https://github.com/openshift/origin/pull/14618#issuecomment-308198063","issue_url":"https://api.github.com/repos/openshift/origin/issues/14618","id":308198063,"user":{"login":"stevekuznetsov","id":7328370,"avatar_url":"https://avatars2.githubusercontent.com/u/7328370?v=3","gravatar_id":"","url":"https://api.github.com/users/stevekuznetsov","html_url":"https://github.com/stevekuznetsov","followers_url":"https://api.github.com/users/stevekuznetsov/followers","following_url":"https://api.github.com/users/stevekuznetsov/following{/other_user}","gists_url":"https://api.github.com/users/stevekuznetsov/gists{/gist_id}","starred_url":"https://api.github.com/users/stevekuznetsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevekuznetsov/subscriptions","organizations_url":"https://api.github.com/users/stevekuznetsov/orgs","repos_url":"https://api.github.com/users/stevekuznetsov/repos","events_url":"https://api.github.com/users/stevekuznetsov/events{/privacy}","received_events_url":"https://api.github.com/users/stevekuznetsov/received_events","type":"User","site_admin":false},"created_at":"2017-06-13T17:57:17Z","updated_at":"2017-06-13T17:57:17Z","body":"Hmm... looks like a bunch of drift. Anyway:\r\n\r\n - when you expect to need `sudo` at some point, call `os::util::environment::use_sudo` in your preamble and call things like:\r\n    ```sh\r\n    ${USE_SUDO:+sudo} action\r\n    ```\r\n - never run your whole script as `sudo`\r\n - never use `sudo` for accessing the `docker.sock` -- add your user to the `docker` group"}}
{"actor":{"display_login":"stevekuznetsov"}}