{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24496","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24496/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24496/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24496/events","html_url":"https://github.com/kubernetes/kubernetes/pull/24496","id":149584871,"number":24496,"title":"rkt: Return `FinishedAt` for pod","user":{"login":"euank","id":2147649,"avatar_url":"https://avatars.githubusercontent.com/u/2147649?v=3","gravatar_id":"","url":"https://api.github.com/users/euank","html_url":"https://github.com/euank","followers_url":"https://api.github.com/users/euank/followers","following_url":"https://api.github.com/users/euank/following{/other_user}","gists_url":"https://api.github.com/users/euank/gists{/gist_id}","starred_url":"https://api.github.com/users/euank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/euank/subscriptions","organizations_url":"https://api.github.com/users/euank/orgs","repos_url":"https://api.github.com/users/euank/repos","events_url":"https://api.github.com/users/euank/events{/privacy}","received_events_url":"https://api.github.com/users/euank/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cla:%20yes","name":"cla: yes","color":"bfe5bf"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-label-needed","name":"release-note-label-needed","color":"db5a64"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/L","name":"size/L","color":"ee9900"}],"state":"open","locked":false,"assignee":{"login":"yifan-gu","id":3278588,"avatar_url":"https://avatars.githubusercontent.com/u/3278588?v=3","gravatar_id":"","url":"https://api.github.com/users/yifan-gu","html_url":"https://github.com/yifan-gu","followers_url":"https://api.github.com/users/yifan-gu/followers","following_url":"https://api.github.com/users/yifan-gu/following{/other_user}","gists_url":"https://api.github.com/users/yifan-gu/gists{/gist_id}","starred_url":"https://api.github.com/users/yifan-gu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yifan-gu/subscriptions","organizations_url":"https://api.github.com/users/yifan-gu/orgs","repos_url":"https://api.github.com/users/yifan-gu/repos","events_url":"https://api.github.com/users/yifan-gu/events{/privacy}","received_events_url":"https://api.github.com/users/yifan-gu/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-04-19T21:08:55Z","updated_at":"2016-04-19T21:51:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/24496","html_url":"https://github.com/kubernetes/kubernetes/pull/24496","diff_url":"https://github.com/kubernetes/kubernetes/pull/24496.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/24496.patch"},"body":"This is implemented via touching a file on stop as a hook in the systemd\r\nunit. The ctime of this file is then used to get the `finishedAt` time\r\nin the future.\r\nIn addition, this changes the `startedAt` and `createdAt` to use the api\r\nserver's results rather than the annotations it previously used.\r\n\r\nIt's possible we might want to move this into the api in the future.\r\n\r\nFixes #23887\r\n\r\n\r\nI did the following manual testing:\r\n```\r\n$ cat ./examples/output/exit-output.yml \r\napiVersion: v1\r\nkind: Pod\r\nmetadata:\r\n  labels:\r\n    name: exit\r\n  name: exit-output\r\nspec:\r\n  restartPolicy: Never\r\n  containers:\r\n    - name: exit\r\n      image: busybox\r\n      command: [\"sh\", \"-c\", \"echo Exiting in 60; sleep 60; echo goodbye\"]\r\n$ kubectl create -f ./examples/exit/exit-output.yaml\r\n$ # wait\r\n$ kubectl describe pod exit-output | grep State -A 4\r\n    State:\t\tTerminated\r\n      Reason:\t\tCompleted\r\n      Exit Code:\t0\r\n      Started:\t\tTue, 19 Apr 2016 13:23:13 -0700\r\n      Finished:\t\tTue, 19 Apr 2016 13:24:13 -0700\r\n$ kubectl logs exit-output\r\nExiting in 60\r\ngoodbye\r\n```\r\n\r\nI double checked as well that the file at `/var/lib/kubelet/pods/$id/finished-$id` existed and looked as expected.\r\n\r\nThis is related to https://github.com/coreos/rkt/issues/1789#issuecomment-207111814 and follows https://github.com/kubernetes/kubernetes/pull/24367 + https://github.com/coreos/rkt/issues/2445\r\n\r\ncc @jonboulle @iaguis @yifan-gu @kubernetes/sig-node"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/212144173","html_url":"https://github.com/kubernetes/kubernetes/pull/24496#issuecomment-212144173","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24496","id":212144173,"user":{"login":"k8s-bot","id":12551979,"avatar_url":"https://avatars.githubusercontent.com/u/12551979?v=3","gravatar_id":"","url":"https://api.github.com/users/k8s-bot","html_url":"https://github.com/k8s-bot","followers_url":"https://api.github.com/users/k8s-bot/followers","following_url":"https://api.github.com/users/k8s-bot/following{/other_user}","gists_url":"https://api.github.com/users/k8s-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/k8s-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8s-bot/subscriptions","organizations_url":"https://api.github.com/users/k8s-bot/orgs","repos_url":"https://api.github.com/users/k8s-bot/repos","events_url":"https://api.github.com/users/k8s-bot/events{/privacy}","received_events_url":"https://api.github.com/users/k8s-bot/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T21:51:23Z","updated_at":"2016-04-19T21:51:23Z","body":"GCE e2e build/test **passed** for commit 49e7a7321d05ccf233ac45650b9f954095898f7f.\n* [Build Log](http://pr-test.k8s.io/24496/kubernetes-pull-build-test-e2e-gce/36104/build-log.txt)\n* [Test Artifacts](https://console.developers.google.com/storage/browser/kubernetes-jenkins/pr-logs/pull/24496/kubernetes-pull-build-test-e2e-gce/36104/artifacts/)\n* [Internal Jenkins Results](http://goto.google.com/prkubekins/job/kubernetes-pull-build-test-e2e-gce//36104)\n"}}