{"action":"created","issue":{"url":"https://api.github.com/repos/garethr/garethr-docker/issues/190","labels_url":"https://api.github.com/repos/garethr/garethr-docker/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/garethr/garethr-docker/issues/190/comments","events_url":"https://api.github.com/repos/garethr/garethr-docker/issues/190/events","html_url":"https://github.com/garethr/garethr-docker/pull/190","id":59050117,"number":190,"title":"Detect when image id changes and restart containers","user":{"login":"shadone","id":25523,"avatar_url":"https://avatars.githubusercontent.com/u/25523?v=3","gravatar_id":"","url":"https://api.github.com/users/shadone","html_url":"https://github.com/shadone","followers_url":"https://api.github.com/users/shadone/followers","following_url":"https://api.github.com/users/shadone/following{/other_user}","gists_url":"https://api.github.com/users/shadone/gists{/gist_id}","starred_url":"https://api.github.com/users/shadone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadone/subscriptions","organizations_url":"https://api.github.com/users/shadone/orgs","repos_url":"https://api.github.com/users/shadone/repos","events_url":"https://api.github.com/users/shadone/events{/privacy}","received_events_url":"https://api.github.com/users/shadone/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-26T10:17:05Z","updated_at":"2015-07-06T07:04:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/garethr/garethr-docker/pulls/190","html_url":"https://github.com/garethr/garethr-docker/pull/190","diff_url":"https://github.com/garethr/garethr-docker/pull/190.diff","patch_url":"https://github.com/garethr/garethr-docker/pull/190.patch"},"body":"Automatically restart container service if the image id has changed."},"comment":{"url":"https://api.github.com/repos/garethr/garethr-docker/issues/comments/118748018","html_url":"https://github.com/garethr/garethr-docker/pull/190#issuecomment-118748018","issue_url":"https://api.github.com/repos/garethr/garethr-docker/issues/190","id":118748018,"user":{"login":"jovandeginste","id":3170771,"avatar_url":"https://avatars.githubusercontent.com/u/3170771?v=3","gravatar_id":"","url":"https://api.github.com/users/jovandeginste","html_url":"https://github.com/jovandeginste","followers_url":"https://api.github.com/users/jovandeginste/followers","following_url":"https://api.github.com/users/jovandeginste/following{/other_user}","gists_url":"https://api.github.com/users/jovandeginste/gists{/gist_id}","starred_url":"https://api.github.com/users/jovandeginste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jovandeginste/subscriptions","organizations_url":"https://api.github.com/users/jovandeginste/orgs","repos_url":"https://api.github.com/users/jovandeginste/repos","events_url":"https://api.github.com/users/jovandeginste/events{/privacy}","received_events_url":"https://api.github.com/users/jovandeginste/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T07:04:43Z","updated_at":"2015-07-06T07:04:43Z","body":"Am I correct that this will only restart the container while you run puppet agent/apply (not 'if' but 'while')? Will the exec part run every time the puppet agent is parsing the code, or only if anything changes elsewhere?\r\n\r\nI'm confused why you put the test in the exec, and not in the init-script; now if anything goed wrong in the imageid-part (eg. the docker-command is not 'docker'), the containers will be restarted every time this part is executed... Can you not make some kind of image-status target in init that exits 0 or 1 when the image is up-to-date or not, and use that in puppet? Even then we still need to be careful how to exit, and respond correctly in the puppet manifest - the containers should only restart when the image id is found on both sides of the equation AND found to be different..."}}