)]}'
{"zun/api/controllers/v1/capsules.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"d4c17f27c62197ec494c9d451bdab856d2bc64d1","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                    container_dict[\u0027memory\u0027] \u003d str(allocation[\u0027memory\u0027])"},{"line_number":234,"context_line":"                container_dict.pop(\u0027resources\u0027)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"            container_dict[\u0027restart_policy\u0027] \u003d container_restart_policy"},{"line_number":237,"context_line":"            utils.check_for_restart_policy(container_dict)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"            if container_dict.get(\u0027volumeMounts\u0027):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_d9aa01d1","line":236,"range":{"start_line":236,"start_character":47,"end_line":236,"end_character":71},"updated":"2018-08-19 18:05:42.000000000","message":"The restart policy of init containers need to be processed differently from the regular containers. See here: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#detailed-behavior\n\n  \"However, if the Pod restartPolicy is set to Always, the Init Containers use RestartPolicy OnFailure.\"","commit_id":"95da260935a7c530da041f1d3833c566573622ac"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"cfa8d274d57f1f32b84b08828d4086d44815862b","unresolved":false,"context_lines":[{"line_number":244,"context_line":"            container_dict[\u0027restart_policy\u0027] \u003d container_restart_policy"},{"line_number":245,"context_line":"            if container_spec in init_containers_spec:"},{"line_number":246,"context_line":"                if capsule_restart_policy \u003d\u003d \"always\":"},{"line_number":247,"context_line":"                    container_restart_policy \u003d {\"MaximumRetryCount\": \"0\","},{"line_number":248,"context_line":"                                                \"Name\": \"on-failure\"}"},{"line_number":249,"context_line":"                    container_dict[\u0027restart_policy\u0027] \u003d container_restart_policy"},{"line_number":250,"context_line":"            utils.check_for_restart_policy(container_dict)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_c1cbaaa2","line":247,"range":{"start_line":247,"start_character":70,"end_line":247,"end_character":71},"updated":"2018-08-22 03:32:00.000000000","message":"I think it is better to pick another number for this. It seems \"0\" means \"no retry\" and it doesn\u0027t match the k8s behavior [1]:\n\n  \"Exited Containers that are restarted by the kubelet are restarted with an exponential back-off delay (10s, 20s, 40s …) capped at five minutes\"\n\nI guess pick a number such as 5 or 10 might emulate k8s better.\n\n[1] https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy","commit_id":"ca50ff676fbccf7d0af5bb148c5d9aa59c31aa98"}],"zun/compute/manager.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"9bbee7b6fd274b4f2f09d12d07a1d8afc2640efd","unresolved":false,"context_lines":[{"line_number":1305,"context_line":"        start_time \u003d time.time()"},{"line_number":1306,"context_line":"        while time.time() - start_time \u003c timeout:"},{"line_number":1307,"context_line":"            container \u003d self.driver.show(context, container)"},{"line_number":1308,"context_line":"            if container.status \u003d\u003d consts.RUNNING:"},{"line_number":1309,"context_line":"                return"},{"line_number":1310,"context_line":"            time.sleep(poll_interval)"},{"line_number":1311,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_f9f1fd02","line":1308,"range":{"start_line":1308,"start_character":42,"end_line":1308,"end_character":49},"updated":"2018-08-19 18:08:55.000000000","message":"Init container should \"run to completion\" so we should check if the container is STOPPED in here.","commit_id":"95da260935a7c530da041f1d3833c566573622ac"}]}
