)]}'
{"karbor/services/protection/protectable_plugins/pod.py":[{"author":{"_account_id":21224,"name":"jiaopengju","email":"jiaopengju_yewu@cmss.chinamobile.com","username":"jiaopengju"},"change_message_id":"13cbd9ab5b0a0f4d032ba497fb549b0e173f8487","unresolved":false,"context_lines":[{"line_number":54,"context_line":"            return [resource.Resource(type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":55,"context_line":"                                      id\u003dpod.metadata.uid,"},{"line_number":56,"context_line":"                                      name\u003dpod.metadata.name)"},{"line_number":57,"context_line":"                    for pod in pods.items"},{"line_number":58,"context_line":"                    if pod.status.phase not in INVALID_POD_STATUS]"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def show_resource(self, context, resource_id, parameters\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_2bac2aeb","line":57,"range":{"start_line":57,"start_character":31,"end_line":57,"end_character":35},"updated":"2017-08-31 01:33:01.000000000","message":"May pods be \u0027None\u0027 here?","commit_id":"ce9ff78f6437de474d22e42fa3adc1db1fb963e3"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"401c3206674ef7c52e174156a1fda1e8b7412775","unresolved":false,"context_lines":[{"line_number":54,"context_line":"            return [resource.Resource(type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":55,"context_line":"                                      id\u003dpod.metadata.uid,"},{"line_number":56,"context_line":"                                      name\u003dpod.metadata.name)"},{"line_number":57,"context_line":"                    for pod in pods.items"},{"line_number":58,"context_line":"                    if pod.status.phase not in INVALID_POD_STATUS]"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def show_resource(self, context, resource_id, parameters\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_372368a9","line":57,"range":{"start_line":57,"start_character":31,"end_line":57,"end_character":35},"in_reply_to":"7f287b81_2bac2aeb","updated":"2017-08-31 09:28:32.000000000","message":"If the list_pod_for_all_namespaces can\u0027t find any pods, it will return a empty list. So here pods.items will be a empty list.","commit_id":"ce9ff78f6437de474d22e42fa3adc1db1fb963e3"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"0514146f279bb9edbc917395ce0870ac66748c5c","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    def show_resource(self, context, resource_id, parameters\u003dNone):"},{"line_number":61,"context_line":"        try:"},{"line_number":62,"context_line":"            pod \u003d self._client(context).read_namespaced_pod("},{"line_number":63,"context_line":"                resource_id, \u0027default\u0027)"},{"line_number":64,"context_line":"        except Exception as e:"},{"line_number":65,"context_line":"            LOG.exception(\"Show a summary pod from kubernetes failed.\")"},{"line_number":66,"context_line":"            raise exception.ProtectableResourceNotFound("}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_b1d40849","line":63,"range":{"start_line":63,"start_character":29,"end_line":63,"end_character":38},"updated":"2017-08-31 07:12:10.000000000","message":"Why a constant \u0027default\u0027? Maybe make this configurable?","commit_id":"ce9ff78f6437de474d22e42fa3adc1db1fb963e3"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"401c3206674ef7c52e174156a1fda1e8b7412775","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    def show_resource(self, context, resource_id, parameters\u003dNone):"},{"line_number":61,"context_line":"        try:"},{"line_number":62,"context_line":"            pod \u003d self._client(context).read_namespaced_pod("},{"line_number":63,"context_line":"                resource_id, \u0027default\u0027)"},{"line_number":64,"context_line":"        except Exception as e:"},{"line_number":65,"context_line":"            LOG.exception(\"Show a summary pod from kubernetes failed.\")"},{"line_number":66,"context_line":"            raise exception.ProtectableResourceNotFound("}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_d73304f5","line":63,"range":{"start_line":63,"start_character":29,"end_line":63,"end_character":38},"in_reply_to":"7f287b81_b1d40849","updated":"2017-08-31 09:28:32.000000000","message":"Making this configurable sounds good.","commit_id":"ce9ff78f6437de474d22e42fa3adc1db1fb963e3"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"0514146f279bb9edbc917395ce0870ac66748c5c","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":69,"context_line":"                reason\u003dsix.text_type(e))"},{"line_number":70,"context_line":"        else:"},{"line_number":71,"context_line":"            if pod.status.phase in INVALID_POD_STATUS:"},{"line_number":72,"context_line":"                raise exception.ProtectableResourceInvalidStatus("},{"line_number":73,"context_line":"                    id\u003dresource_id, type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":74,"context_line":"                    status\u003dpod.status.phase)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_b1ebe810","line":71,"range":{"start_line":71,"start_character":15,"end_line":71,"end_character":31},"updated":"2017-08-31 07:12:10.000000000","message":"Maybe pod or pod.status is None?","commit_id":"ce9ff78f6437de474d22e42fa3adc1db1fb963e3"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"401c3206674ef7c52e174156a1fda1e8b7412775","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":69,"context_line":"                reason\u003dsix.text_type(e))"},{"line_number":70,"context_line":"        else:"},{"line_number":71,"context_line":"            if pod.status.phase in INVALID_POD_STATUS:"},{"line_number":72,"context_line":"                raise exception.ProtectableResourceInvalidStatus("},{"line_number":73,"context_line":"                    id\u003dresource_id, type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":74,"context_line":"                    status\u003dpod.status.phase)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_d748a45c","line":71,"range":{"start_line":71,"start_character":15,"end_line":71,"end_character":31},"in_reply_to":"7f287b81_b1ebe810","updated":"2017-08-31 09:28:32.000000000","message":"If the API read_namespaced_pod can not find the pod, it will return a notfound exception. So here pod can not be null.","commit_id":"ce9ff78f6437de474d22e42fa3adc1db1fb963e3"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"0514146f279bb9edbc917395ce0870ac66748c5c","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                    id\u003dresource_id, type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":74,"context_line":"                    status\u003dpod.status.phase)"},{"line_number":75,"context_line":"            return resource.Resource(type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":76,"context_line":"                                     id\u003dpod.metadata.uid,"},{"line_number":77,"context_line":"                                     name\u003dpod.metadata.name)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def get_dependent_resources(self, context, parent_resource):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_71f10001","line":76,"range":{"start_line":76,"start_character":40,"end_line":76,"end_character":56},"updated":"2017-08-31 07:12:10.000000000","message":"Ditto about metadata","commit_id":"ce9ff78f6437de474d22e42fa3adc1db1fb963e3"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"401c3206674ef7c52e174156a1fda1e8b7412775","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                    id\u003dresource_id, type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":74,"context_line":"                    status\u003dpod.status.phase)"},{"line_number":75,"context_line":"            return resource.Resource(type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":76,"context_line":"                                     id\u003dpod.metadata.uid,"},{"line_number":77,"context_line":"                                     name\u003dpod.metadata.name)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def get_dependent_resources(self, context, parent_resource):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_d7aae46e","line":76,"range":{"start_line":76,"start_character":40,"end_line":76,"end_character":56},"in_reply_to":"7f287b81_71f10001","updated":"2017-08-31 09:28:32.000000000","message":"If the pod is returned successfully, the metadata and status are the base objects of this pod. They will not be None.","commit_id":"ce9ff78f6437de474d22e42fa3adc1db1fb963e3"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"0514146f279bb9edbc917395ce0870ac66748c5c","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def get_dependent_resources(self, context, parent_resource):"},{"line_number":80,"context_line":"        try:"},{"line_number":81,"context_line":"            pods \u003d self._client(context).list_pod_for_all_namespaces()"},{"line_number":82,"context_line":"        except Exception as e:"},{"line_number":83,"context_line":"            LOG.exception(\"List all pods from kubernetes failed.\")"},{"line_number":84,"context_line":"            raise exception.ListProtectableResourceFailed("}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_713fc086","line":81,"range":{"start_line":81,"start_character":41,"end_line":81,"end_character":68},"updated":"2017-08-31 07:12:10.000000000","message":"Why all namespaces? IMO should be a specific namespace (or maybe configurable between a specific namespace and all namespaces)","commit_id":"ce9ff78f6437de474d22e42fa3adc1db1fb963e3"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"401c3206674ef7c52e174156a1fda1e8b7412775","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def get_dependent_resources(self, context, parent_resource):"},{"line_number":80,"context_line":"        try:"},{"line_number":81,"context_line":"            pods \u003d self._client(context).list_pod_for_all_namespaces()"},{"line_number":82,"context_line":"        except Exception as e:"},{"line_number":83,"context_line":"            LOG.exception(\"List all pods from kubernetes failed.\")"},{"line_number":84,"context_line":"            raise exception.ListProtectableResourceFailed("}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_77c1f053","line":81,"range":{"start_line":81,"start_character":41,"end_line":81,"end_character":68},"in_reply_to":"7f287b81_713fc086","updated":"2017-08-31 09:28:32.000000000","message":"I find this API list_namespaced_pod. Listing all namespaces is not a good idea, the systemic pod also be returned. So I will make the namespace configurable.","commit_id":"ce9ff78f6437de474d22e42fa3adc1db1fb963e3"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"0514146f279bb9edbc917395ce0870ac66748c5c","unresolved":false,"context_lines":[{"line_number":86,"context_line":"                reason\u003dsix.text_type(e))"},{"line_number":87,"context_line":"        else:"},{"line_number":88,"context_line":"            return [resource.Resource(type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":89,"context_line":"                                      id\u003dpod.metadata.uid,"},{"line_number":90,"context_line":"                                      name\u003dpod.metadata.name)"},{"line_number":91,"context_line":"                    for pod in pods"},{"line_number":92,"context_line":"                    if pod.project_id \u003d\u003d parent_resource.id"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_710d80e6","line":89,"range":{"start_line":89,"start_character":41,"end_line":89,"end_character":57},"updated":"2017-08-31 07:12:10.000000000","message":"ditto","commit_id":"ce9ff78f6437de474d22e42fa3adc1db1fb963e3"},{"author":{"_account_id":20883,"name":"Yuval Brik","email":"yuval@brik.org.il","username":"yuvalbr"},"change_message_id":"0514146f279bb9edbc917395ce0870ac66748c5c","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                                      name\u003dpod.metadata.name)"},{"line_number":91,"context_line":"                    for pod in pods"},{"line_number":92,"context_line":"                    if pod.project_id \u003d\u003d parent_resource.id"},{"line_number":93,"context_line":"                    and pod.status.phase not in INVALID_POD_STATUS]"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_f10050ad","line":93,"range":{"start_line":93,"start_character":24,"end_line":93,"end_character":40},"updated":"2017-08-31 07:12:10.000000000","message":"ditto","commit_id":"ce9ff78f6437de474d22e42fa3adc1db1fb963e3"},{"author":{"_account_id":21224,"name":"jiaopengju","email":"jiaopengju_yewu@cmss.chinamobile.com","username":"jiaopengju"},"change_message_id":"e8837ed0892b4f5639f7d484c54ce215d56352bd","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                                     extra_info\u003d{\u0027namespace\u0027: self.namespace})"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def get_dependent_resources(self, context, parent_resource):"},{"line_number":102,"context_line":"        try:"},{"line_number":103,"context_line":"            pods \u003d self._client(context).list_namespaced_pod(self.namespace)"},{"line_number":104,"context_line":"        except Exception as e:"},{"line_number":105,"context_line":"            LOG.exception(\"List all summary pods from kubernetes failed.\")"},{"line_number":106,"context_line":"            raise exception.ListProtectableResourceFailed("},{"line_number":107,"context_line":"                type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":108,"context_line":"                reason\u003dsix.text_type(e))"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            return [resource.Resource(type\u003dself._SUPPORT_RESOURCE_TYPE,"},{"line_number":111,"context_line":"                                      id\u003dpod.metadata.uid,"},{"line_number":112,"context_line":"                                      name\u003dpod.metadata.name,"},{"line_number":113,"context_line":"                                      extra_info\u003d{\u0027namespace\u0027: self.namespace})"},{"line_number":114,"context_line":"                    for pod in pods.items"},{"line_number":115,"context_line":"                    if pod.status.phase not in INVALID_POD_STATUS]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_745f6e0e","line":115,"range":{"start_line":102,"start_character":8,"end_line":115,"end_character":66},"updated":"2017-09-04 00:50:36.000000000","message":"how about use self.list_resources instead? same code.","commit_id":"e9dcd9da982f6e066a1f5d8f5c5f1d5ecef2d27f"}]}
