)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"7af2b27e6ac79ca39974a58eca705271ebf32f5f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"8426a21b_5cf5dfaa","updated":"2021-10-12 17:35:07.000000000","message":"recheck","commit_id":"c0451006ef3340fbe1b01a7e92e0cff8bff42415"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"70c3c5b66d69e0293ea9464f2691b7900cf64e8f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"8a462398_0cc696f9","updated":"2021-10-13 10:42:57.000000000","message":"recheck","commit_id":"c0451006ef3340fbe1b01a7e92e0cff8bff42415"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"2a5478fd2b8d1d07943c108af5d1127ca1102d87","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"e375f52a_a150ae51","updated":"2021-10-13 17:05:20.000000000","message":"recheck","commit_id":"c0451006ef3340fbe1b01a7e92e0cff8bff42415"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"8b7cdb247d1baf63f52d8a979341d7742142daab","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"b632bcce_9e63fe7f","updated":"2021-10-14 23:18:20.000000000","message":"recheck","commit_id":"ac175c65f53b39f0fcb00fc803983799e648acf4"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"a15185b50ce2e9cf16f86d654257151c53dc305d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"a12590ee_cddccfc3","updated":"2021-10-17 12:47:05.000000000","message":"recheck","commit_id":"e44c4e177c1304035f5f30ef9dfc51c6eeb688c7"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8564fd953af3cefb6f08246f33fc7e3ce3761364","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"85b45431_696dca75","updated":"2021-10-21 16:01:07.000000000","message":"I still want to try to prove that this might break network policies enforcement. My idea is that if e.g. I have an egress NP that only allows traffic to a namespace that doesn\u0027t yet have CIDR, then the SG rule will not get created for that namespace and after the namespace finally gets the CIDR, nothing will trigger reevaluation of the NP.\n\nI\u0027m deploying an env to test that, meanwhile some small comments inline.","commit_id":"fce199b4351bb99ee6d7db0f9a46d7a8c37c9918"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"8a0887f9890cafe1728e04cd7f25e8772bd9f471","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"bb272dd2_ee015a9f","in_reply_to":"85b45431_696dca75","updated":"2021-10-24 12:03:02.000000000","message":"I have just tested this scenario and the update_namespace_sg_rules[0] will trigger the bump of the Network Policy. The steps I took were the following:\n\n1. create a NP allowing egress with a namespaceselector test\n2. create namespace test with label test\n3. check no crd is there and network policy has no cidr yet to that namespace\n4. create pod (this will trigger creation of kuryrnetwork CRD and update of the sg rules)\n\n\n[0] https://github.com/openstack/kuryr-kubernetes/blob/master/kuryr_kubernetes/controller/handlers/kuryrnetwork.py#L84","commit_id":"fce199b4351bb99ee6d7db0f9a46d7a8c37c9918"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"8b58fe811ecfa47c35bbb590ffe688910f3fa13b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"91ee8ac9_a774e29f","updated":"2021-10-28 12:45:23.000000000","message":"Just small nit regarding removing too much, otherwise looks good!","commit_id":"3304c228fd51b6d34c02439ba924e382307bc7b6"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"8a0887f9890cafe1728e04cd7f25e8772bd9f471","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"7ce63d55_b6975f11","updated":"2021-10-24 12:03:02.000000000","message":"Thank you for the review, Michal. I tested the corner case and it looked okay.","commit_id":"3304c228fd51b6d34c02439ba924e382307bc7b6"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"ca8e744ed89988d3608db5cf3d5a2b9ca758cf5e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"50977934_1d83290e","updated":"2021-10-26 13:03:12.000000000","message":"recheck","commit_id":"3304c228fd51b6d34c02439ba924e382307bc7b6"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"a1cda225a4783b608d80d314fa82e95a7e234641","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"6069bfd0_9a216636","updated":"2021-10-27 09:36:18.000000000","message":"recheck","commit_id":"3304c228fd51b6d34c02439ba924e382307bc7b6"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"c367cb79aa3eccfa867fe676b39e4f73ab6b2f54","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"e7bc69b9_8804cb53","updated":"2021-10-25 07:50:07.000000000","message":"recheck","commit_id":"3304c228fd51b6d34c02439ba924e382307bc7b6"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"fda85833991d31b6aa63cc922803bd1cad982b29","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"f33e17bf_51045be1","updated":"2021-10-25 10:54:13.000000000","message":"recheck","commit_id":"3304c228fd51b6d34c02439ba924e382307bc7b6"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"70dfcfcefa7613aec843f2a88fe71841f5dd44c4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"b21c7849_96d25d52","updated":"2021-10-27 13:16:29.000000000","message":"recheck\n\nOkay, I couldn\u0027t cause it to break NPs and I tried various scenarios. I think this works.","commit_id":"3304c228fd51b6d34c02439ba924e382307bc7b6"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"0a5498f9a2abd880ab261e7b3261a8fd1f104f58","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"f5fd4286_117b3cda","updated":"2021-11-04 18:42:16.000000000","message":"recheck","commit_id":"32cdda491482a7881d7c72d9ab8aeb2d50311f45"}],"kuryr_kubernetes/controller/handlers/loadbalancer.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e96915c131ba42d5e480e6eba57a498e1f704c48","unresolved":true,"context_lines":[{"line_number":436,"context_line":"        project_id \u003d self._drv_pod_project.get_project(pod)"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        subnet_ids \u003d []"},{"line_number":439,"context_line":"        if not pod[\u0027spec\u0027].get(\u0027hostNetwork\u0027):"},{"line_number":440,"context_line":"            subnets_map \u003d self._drv_pod_subnets.get_subnets(pod, project_id)"},{"line_number":441,"context_line":"            subnet_ids \u003d [subnet_id"},{"line_number":442,"context_line":"                          for subnet_id, network in subnets_map.items()"}],"source_content_type":"text/x-python","patch_set":1,"id":"d1ce6a43_4ae43372","line":439,"range":{"start_line":439,"start_character":11,"end_line":439,"end_character":45},"updated":"2021-10-06 11:15:12.000000000","message":"Why not use a function [1]?\n\n[1] https://github.com/openstack/kuryr-kubernetes/blob/deb055190f1c4d337534124a49935916511a9ab1/kuryr_kubernetes/controller/drivers/utils.py#L83-L84","commit_id":"1eec3e1d946bbc683b8c7ffdc8e991bf4bd04c4a"}],"kuryr_kubernetes/controller/handlers/namespace.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e96915c131ba42d5e480e6eba57a498e1f704c48","unresolved":true,"context_lines":[{"line_number":38,"context_line":"        ns_name \u003d namespace[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        if not utils.handle_namespace(ns_name):"},{"line_number":41,"context_line":"            LOG.debug(\"Namespace %s has no Pods that should be handled.\""},{"line_number":42,"context_line":"                      \"Skipping event.\", ns_name)"},{"line_number":43,"context_line":"            return"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"af6f292d_aefeab8d","line":41,"range":{"start_line":41,"start_character":71,"end_line":41,"end_character":72},"updated":"2021-10-06 11:15:12.000000000","message":"Missing space.","commit_id":"1eec3e1d946bbc683b8c7ffdc8e991bf4bd04c4a"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8564fd953af3cefb6f08246f33fc7e3ce3761364","unresolved":true,"context_lines":[{"line_number":36,"context_line":"    def on_present(self, namespace, *args, **kwargs):"},{"line_number":37,"context_line":"        ns_labels \u003d namespace[\u0027metadata\u0027].get(\u0027labels\u0027, {})"},{"line_number":38,"context_line":"        ns_name \u003d namespace[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        if not utils.handle_namespace(ns_name):"},{"line_number":41,"context_line":"            LOG.debug(\"Namespace %s has no Pods that should be handled. \""},{"line_number":42,"context_line":"                      \"Skipping event.\", ns_name)"},{"line_number":43,"context_line":"            return"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        kns_crd \u003d self._get_kns_crd(ns_name)"},{"line_number":46,"context_line":"        if kns_crd:"}],"source_content_type":"text/x-python","patch_set":11,"id":"8d048dac_e808c3bc","line":43,"range":{"start_line":39,"start_character":0,"end_line":43,"end_character":18},"updated":"2021-10-21 16:01:07.000000000","message":"What if there are no pods now, but there were pods? Do we want to skip running _update_labels() in such case?","commit_id":"fce199b4351bb99ee6d7db0f9a46d7a8c37c9918"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"8a0887f9890cafe1728e04cd7f25e8772bd9f471","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    def on_present(self, namespace, *args, **kwargs):"},{"line_number":37,"context_line":"        ns_labels \u003d namespace[\u0027metadata\u0027].get(\u0027labels\u0027, {})"},{"line_number":38,"context_line":"        ns_name \u003d namespace[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        if not utils.handle_namespace(ns_name):"},{"line_number":41,"context_line":"            LOG.debug(\"Namespace %s has no Pods that should be handled. \""},{"line_number":42,"context_line":"                      \"Skipping event.\", ns_name)"},{"line_number":43,"context_line":"            return"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        kns_crd \u003d self._get_kns_crd(ns_name)"},{"line_number":46,"context_line":"        if kns_crd:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9b399ac4_5bb36d6e","line":43,"range":{"start_line":39,"start_character":0,"end_line":43,"end_character":18},"in_reply_to":"8d048dac_e808c3bc","updated":"2021-10-24 12:03:02.000000000","message":"Good point, I believe it\u0027s better to move this restriction to only when there is no kuryrNetwork CRD yet because we don\u0027t delete the network/subnet when there is no pod anymore, so we can have better control to when update the NP CR.","commit_id":"fce199b4351bb99ee6d7db0f9a46d7a8c37c9918"}],"kuryr_kubernetes/controller/handlers/vif.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e96915c131ba42d5e480e6eba57a498e1f704c48","unresolved":true,"context_lines":[{"line_number":80,"context_line":"        kuryrnetwork \u003d driver_utils.get_k8s_resource(kuryrnetwork_path)"},{"line_number":81,"context_line":"        kuryrnetwork_status \u003d kuryrnetwork.get(\u0027status\u0027, {})"},{"line_number":82,"context_line":"        if (not kuryrnetwork or"},{"line_number":83,"context_line":"                (kuryrnetwork and not kuryrnetwork_status.get(\u0027routerId\u0027))):"},{"line_number":84,"context_line":"            namespace_path \u003d \u0027{}/{}\u0027.format("},{"line_number":85,"context_line":"                constants.K8S_API_NAMESPACES, namespace)"},{"line_number":86,"context_line":"            LOG.debug(\"Triggering Namespace Handling %s\", namespace_path)"}],"source_content_type":"text/x-python","patch_set":1,"id":"c5133d23_16c762cc","line":83,"range":{"start_line":83,"start_character":17,"end_line":83,"end_character":29},"updated":"2021-10-06 11:15:12.000000000","message":"You\u0027ve already ruled out case in which `not kuryrnetwork` is true.","commit_id":"1eec3e1d946bbc683b8c7ffdc8e991bf4bd04c4a"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e96915c131ba42d5e480e6eba57a498e1f704c48","unresolved":true,"context_lines":[{"line_number":85,"context_line":"                constants.K8S_API_NAMESPACES, namespace)"},{"line_number":86,"context_line":"            LOG.debug(\"Triggering Namespace Handling %s\", namespace_path)"},{"line_number":87,"context_line":"            try:"},{"line_number":88,"context_line":"                k8s.annotate(namespace_path, {\u0027KuryrTrigger\u0027: \u00271\u0027})"},{"line_number":89,"context_line":"            except k_exc.K8sResourceNotFound:"},{"line_number":90,"context_line":"                LOG.error(\u0027Ignoring Pod handling, no Namespace %s.\u0027, namespace)"},{"line_number":91,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":1,"id":"cb30a517_b774ef43","line":88,"range":{"start_line":88,"start_character":62,"end_line":88,"end_character":65},"updated":"2021-10-06 11:15:12.000000000","message":"I think I\u0027d just place some random `uuid.uuid4()` here instead, so that the event will be retriggered in any case. I also wonder if we shouldn\u0027t just place it as a part of `status`, but at this point I\u0027d rather stick to your approach.","commit_id":"1eec3e1d946bbc683b8c7ffdc8e991bf4bd04c4a"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"76b3a21a3ed4af6bbf43c738505dd5af7d6b78de","unresolved":true,"context_lines":[{"line_number":85,"context_line":"                constants.K8S_API_NAMESPACES, namespace)"},{"line_number":86,"context_line":"            LOG.debug(\"Triggering Namespace Handling %s\", namespace_path)"},{"line_number":87,"context_line":"            try:"},{"line_number":88,"context_line":"                k8s.annotate(namespace_path, {\u0027KuryrTrigger\u0027: \u00271\u0027})"},{"line_number":89,"context_line":"            except k_exc.K8sResourceNotFound:"},{"line_number":90,"context_line":"                LOG.error(\u0027Ignoring Pod handling, no Namespace %s.\u0027, namespace)"},{"line_number":91,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":1,"id":"876a1472_89e466d4","line":88,"range":{"start_line":88,"start_character":62,"end_line":88,"end_character":65},"in_reply_to":"cb30a517_b774ef43","updated":"2021-10-08 10:08:49.000000000","message":"okay. Note that this is being added to the Namespace, I\u0027m not sure it would have a status section","commit_id":"1eec3e1d946bbc683b8c7ffdc8e991bf4bd04c4a"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e96915c131ba42d5e480e6eba57a498e1f704c48","unresolved":true,"context_lines":[{"line_number":73,"context_line":"                          \" Skipping\")"},{"line_number":74,"context_line":"            return"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        namespace \u003d pod[\u0027metadata\u0027][\u0027namespace\u0027]"},{"line_number":77,"context_line":"        kuryrnetwork_path \u003d \u0027{}/{}/kuryrnetworks/{}\u0027.format("},{"line_number":78,"context_line":"            constants.K8S_API_CRD_NAMESPACES, namespace,"},{"line_number":79,"context_line":"            namespace)"},{"line_number":80,"context_line":"        kuryrnetwork \u003d driver_utils.get_k8s_resource(kuryrnetwork_path)"},{"line_number":81,"context_line":"        kuryrnetwork_status \u003d kuryrnetwork.get(\u0027status\u0027, {})"},{"line_number":82,"context_line":"        if (not kuryrnetwork or"},{"line_number":83,"context_line":"                (kuryrnetwork and not kuryrnetwork_status.get(\u0027routerId\u0027))):"},{"line_number":84,"context_line":"            namespace_path \u003d \u0027{}/{}\u0027.format("},{"line_number":85,"context_line":"                constants.K8S_API_NAMESPACES, namespace)"},{"line_number":86,"context_line":"            LOG.debug(\"Triggering Namespace Handling %s\", namespace_path)"},{"line_number":87,"context_line":"            try:"},{"line_number":88,"context_line":"                k8s.annotate(namespace_path, {\u0027KuryrTrigger\u0027: \u00271\u0027})"},{"line_number":89,"context_line":"            except k_exc.K8sResourceNotFound:"},{"line_number":90,"context_line":"                LOG.error(\u0027Ignoring Pod handling, no Namespace %s.\u0027, namespace)"},{"line_number":91,"context_line":"                return"},{"line_number":92,"context_line":"            raise k_exc.ResourceNotReady(pod)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        LOG.debug(\"Got KuryrPort: %r\", kp)"},{"line_number":95,"context_line":"        if not kp:"}],"source_content_type":"text/x-python","patch_set":1,"id":"e5093fbd_ba86c5c7","line":92,"range":{"start_line":76,"start_character":0,"end_line":92,"end_character":45},"updated":"2021-10-06 11:15:12.000000000","message":"This might be a bold idea, but we could also extract that into a separate handler that\u0027d watch pods. I\u0027m not sure if we want to have handlers with more granular functions starting here, but it might not be a bad idea given how the code of original handlers is growing.\n\nThoughts?","commit_id":"1eec3e1d946bbc683b8c7ffdc8e991bf4bd04c4a"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"76b3a21a3ed4af6bbf43c738505dd5af7d6b78de","unresolved":true,"context_lines":[{"line_number":73,"context_line":"                          \" Skipping\")"},{"line_number":74,"context_line":"            return"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        namespace \u003d pod[\u0027metadata\u0027][\u0027namespace\u0027]"},{"line_number":77,"context_line":"        kuryrnetwork_path \u003d \u0027{}/{}/kuryrnetworks/{}\u0027.format("},{"line_number":78,"context_line":"            constants.K8S_API_CRD_NAMESPACES, namespace,"},{"line_number":79,"context_line":"            namespace)"},{"line_number":80,"context_line":"        kuryrnetwork \u003d driver_utils.get_k8s_resource(kuryrnetwork_path)"},{"line_number":81,"context_line":"        kuryrnetwork_status \u003d kuryrnetwork.get(\u0027status\u0027, {})"},{"line_number":82,"context_line":"        if (not kuryrnetwork or"},{"line_number":83,"context_line":"                (kuryrnetwork and not kuryrnetwork_status.get(\u0027routerId\u0027))):"},{"line_number":84,"context_line":"            namespace_path \u003d \u0027{}/{}\u0027.format("},{"line_number":85,"context_line":"                constants.K8S_API_NAMESPACES, namespace)"},{"line_number":86,"context_line":"            LOG.debug(\"Triggering Namespace Handling %s\", namespace_path)"},{"line_number":87,"context_line":"            try:"},{"line_number":88,"context_line":"                k8s.annotate(namespace_path, {\u0027KuryrTrigger\u0027: \u00271\u0027})"},{"line_number":89,"context_line":"            except k_exc.K8sResourceNotFound:"},{"line_number":90,"context_line":"                LOG.error(\u0027Ignoring Pod handling, no Namespace %s.\u0027, namespace)"},{"line_number":91,"context_line":"                return"},{"line_number":92,"context_line":"            raise k_exc.ResourceNotReady(pod)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        LOG.debug(\"Got KuryrPort: %r\", kp)"},{"line_number":95,"context_line":"        if not kp:"}],"source_content_type":"text/x-python","patch_set":1,"id":"586a9794_c886bd85","line":92,"range":{"start_line":76,"start_character":0,"end_line":92,"end_character":45},"in_reply_to":"e5093fbd_ba86c5c7","updated":"2021-10-08 10:08:49.000000000","message":"You mean to be similar to the PodLabel handler?\nI\u0027m not sure about this approach, since what is being included is a restriction on the processing of Pods events and not a new functionality around Pods, I think we would end up having duplicated code on the new handler to the add the Kuryr Port CRD. wdyt?","commit_id":"1eec3e1d946bbc683b8c7ffdc8e991bf4bd04c4a"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8564fd953af3cefb6f08246f33fc7e3ce3761364","unresolved":true,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from oslo_config import cfg"},{"line_number":17,"context_line":"from oslo_log import log as logging"},{"line_number":18,"context_line":"import uuid"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from kuryr_kubernetes import clients"},{"line_number":21,"context_line":"from kuryr_kubernetes import constants"}],"source_content_type":"text/x-python","patch_set":11,"id":"4fc5b321_aceebef9","line":18,"range":{"start_line":18,"start_character":0,"end_line":18,"end_character":11},"updated":"2021-10-21 16:01:07.000000000","message":"This module is in standard lib, should be in a separate group above oslo imports.","commit_id":"fce199b4351bb99ee6d7db0f9a46d7a8c37c9918"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"8a0887f9890cafe1728e04cd7f25e8772bd9f471","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from oslo_config import cfg"},{"line_number":17,"context_line":"from oslo_log import log as logging"},{"line_number":18,"context_line":"import uuid"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from kuryr_kubernetes import clients"},{"line_number":21,"context_line":"from kuryr_kubernetes import constants"}],"source_content_type":"text/x-python","patch_set":11,"id":"4b3bc648_a70df27f","line":18,"range":{"start_line":18,"start_character":0,"end_line":18,"end_character":11},"in_reply_to":"4fc5b321_aceebef9","updated":"2021-10-24 12:03:02.000000000","message":"Done","commit_id":"fce199b4351bb99ee6d7db0f9a46d7a8c37c9918"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8564fd953af3cefb6f08246f33fc7e3ce3761364","unresolved":true,"context_lines":[{"line_number":77,"context_line":"                k8s.annotate(namespace_path,"},{"line_number":78,"context_line":"                             {\u0027KuryrTrigger\u0027: str(uuid.uuid4())})"},{"line_number":79,"context_line":"            except k_exc.K8sResourceNotFound:"},{"line_number":80,"context_line":"                LOG.error(\u0027Ignoring Pod handling, no Namespace %s.\u0027, namespace)"},{"line_number":81,"context_line":"                return"},{"line_number":82,"context_line":"            raise k_exc.ResourceNotReady(pod)"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"4ae65648_1fdd022e","line":80,"range":{"start_line":80,"start_character":20,"end_line":80,"end_character":25},"updated":"2021-10-21 16:01:07.000000000","message":"This could probably be just a warning? Someone just deleted the namespace.","commit_id":"fce199b4351bb99ee6d7db0f9a46d7a8c37c9918"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"8a0887f9890cafe1728e04cd7f25e8772bd9f471","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                k8s.annotate(namespace_path,"},{"line_number":78,"context_line":"                             {\u0027KuryrTrigger\u0027: str(uuid.uuid4())})"},{"line_number":79,"context_line":"            except k_exc.K8sResourceNotFound:"},{"line_number":80,"context_line":"                LOG.error(\u0027Ignoring Pod handling, no Namespace %s.\u0027, namespace)"},{"line_number":81,"context_line":"                return"},{"line_number":82,"context_line":"            raise k_exc.ResourceNotReady(pod)"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5b7abfd2_e61c5932","line":80,"range":{"start_line":80,"start_character":20,"end_line":80,"end_character":25},"in_reply_to":"4ae65648_1fdd022e","updated":"2021-10-24 12:03:02.000000000","message":"Done","commit_id":"fce199b4351bb99ee6d7db0f9a46d7a8c37c9918"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"8b58fe811ecfa47c35bbb590ffe688910f3fa13b","unresolved":true,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        # NOTE(gryf): Set the finalizer as soon, as we have pod created. On"},{"line_number":62,"context_line":"        # subsequent updates of the pod, add_finalizer will ignore this if"},{"line_number":63,"context_line":"        # finalizer exists."},{"line_number":64,"context_line":"        k8s \u003d clients.get_kubernetes_client()"},{"line_number":65,"context_line":"        try:"},{"line_number":66,"context_line":"            if not k8s.add_finalizer(pod, constants.POD_FINALIZER):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1e0947d5_2b4f05a1","side":"PARENT","line":63,"updated":"2021-10-28 12:45:23.000000000","message":"I guess, that comment should stay.","commit_id":"6440cfea25d1c07982eb3c64c981e90b7633435f"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4a9b5f352803536df91a40e4692d92f211266da4","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        # NOTE(gryf): Set the finalizer as soon, as we have pod created. On"},{"line_number":62,"context_line":"        # subsequent updates of the pod, add_finalizer will ignore this if"},{"line_number":63,"context_line":"        # finalizer exists."},{"line_number":64,"context_line":"        k8s \u003d clients.get_kubernetes_client()"},{"line_number":65,"context_line":"        try:"},{"line_number":66,"context_line":"            if not k8s.add_finalizer(pod, constants.POD_FINALIZER):"}],"source_content_type":"text/x-python","patch_set":12,"id":"910e716b_55535cc1","side":"PARENT","line":63,"in_reply_to":"1e0947d5_2b4f05a1","updated":"2021-10-29 09:32:07.000000000","message":"Done","commit_id":"6440cfea25d1c07982eb3c64c981e90b7633435f"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"8b58fe811ecfa47c35bbb590ffe688910f3fa13b","unresolved":true,"context_lines":[{"line_number":131,"context_line":"            # method on the KuryrPort."},{"line_number":132,"context_line":"            try:"},{"line_number":133,"context_line":"                k8s.annotate(utils.get_res_link(kp),"},{"line_number":134,"context_line":"                             {\u0027KuryrTrigger\u0027: str(uuid.uuid4())})"},{"line_number":135,"context_line":"            except k_exc.K8sResourceNotFound:"},{"line_number":136,"context_line":"                LOG.error(\u0027Cannot annotate existing KuryrPort %s.\u0027,"},{"line_number":137,"context_line":"                          kp[\u0027metadata\u0027][\u0027name\u0027])"}],"source_content_type":"text/x-python","patch_set":12,"id":"790a3b67_2e1aeea3","line":134,"range":{"start_line":134,"start_character":46,"end_line":134,"end_character":62},"updated":"2021-10-28 12:45:23.000000000","message":"Neat!","commit_id":"3304c228fd51b6d34c02439ba924e382307bc7b6"}],"kuryr_kubernetes/utils.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e96915c131ba42d5e480e6eba57a498e1f704c48","unresolved":true,"context_lines":[{"line_number":644,"context_line":"            \u0027{}/namespaces/{}/pods\u0027.format("},{"line_number":645,"context_line":"                constants.K8S_API_BASE, namespace))"},{"line_number":646,"context_line":"    for pod in pods.get(\"items\"):"},{"line_number":647,"context_line":"        if not pod[\u0027spec\u0027].get(\u0027hostNetwork\u0027):"},{"line_number":648,"context_line":"            return True"},{"line_number":649,"context_line":"    return False"}],"source_content_type":"text/x-python","patch_set":1,"id":"7e66aeb4_7933314e","line":647,"range":{"start_line":647,"start_character":15,"end_line":647,"end_character":45},"updated":"2021-10-06 11:15:12.000000000","message":"We have utility function for that.\n\nAlso we can just do something like:\n\n return not all((driver_utils.is_host_network(pod) for pod in pods.get(\u0027items\u0027, [])))","commit_id":"1eec3e1d946bbc683b8c7ffdc8e991bf4bd04c4a"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8564fd953af3cefb6f08246f33fc7e3ce3761364","unresolved":true,"context_lines":[{"line_number":660,"context_line":"def is_host_network(pod):"},{"line_number":661,"context_line":"    return pod[\u0027spec\u0027].get(\u0027hostNetwork\u0027, False)"},{"line_number":662,"context_line":""},{"line_number":663,"context_line":""},{"line_number":664,"context_line":"def handle_namespace(namespace):"},{"line_number":665,"context_line":"    \"\"\"Evaluate if the Namespace should be handled"},{"line_number":666,"context_line":""},{"line_number":667,"context_line":"    Fetches all the Pods in the Namespace and check"},{"line_number":668,"context_line":"    if there is any Pod in that Namespace on Pods Network."},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    :param namespace: Namespace name"},{"line_number":671,"context_line":"    :returns: True if the Namespace resources should be"},{"line_number":672,"context_line":"              created, False if otherwise."},{"line_number":673,"context_line":"    \"\"\""},{"line_number":674,"context_line":"    kubernetes \u003d clients.get_kubernetes_client()"},{"line_number":675,"context_line":"    pods \u003d kubernetes.get("},{"line_number":676,"context_line":"            \u0027{}/namespaces/{}/pods\u0027.format("},{"line_number":677,"context_line":"                constants.K8S_API_BASE, namespace))"},{"line_number":678,"context_line":"    return any(not is_host_network(pod)"},{"line_number":679,"context_line":"               for pod in pods.get(\u0027items\u0027, []))"}],"source_content_type":"text/x-python","patch_set":11,"id":"f1b5bced_57d74338","line":679,"range":{"start_line":663,"start_character":0,"end_line":679,"end_character":48},"updated":"2021-10-21 16:01:07.000000000","message":"This seems like it\u0027s only being used in one place, why not put it into the handler that uses it?","commit_id":"fce199b4351bb99ee6d7db0f9a46d7a8c37c9918"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"8a0887f9890cafe1728e04cd7f25e8772bd9f471","unresolved":false,"context_lines":[{"line_number":660,"context_line":"def is_host_network(pod):"},{"line_number":661,"context_line":"    return pod[\u0027spec\u0027].get(\u0027hostNetwork\u0027, False)"},{"line_number":662,"context_line":""},{"line_number":663,"context_line":""},{"line_number":664,"context_line":"def handle_namespace(namespace):"},{"line_number":665,"context_line":"    \"\"\"Evaluate if the Namespace should be handled"},{"line_number":666,"context_line":""},{"line_number":667,"context_line":"    Fetches all the Pods in the Namespace and check"},{"line_number":668,"context_line":"    if there is any Pod in that Namespace on Pods Network."},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    :param namespace: Namespace name"},{"line_number":671,"context_line":"    :returns: True if the Namespace resources should be"},{"line_number":672,"context_line":"              created, False if otherwise."},{"line_number":673,"context_line":"    \"\"\""},{"line_number":674,"context_line":"    kubernetes \u003d clients.get_kubernetes_client()"},{"line_number":675,"context_line":"    pods \u003d kubernetes.get("},{"line_number":676,"context_line":"            \u0027{}/namespaces/{}/pods\u0027.format("},{"line_number":677,"context_line":"                constants.K8S_API_BASE, namespace))"},{"line_number":678,"context_line":"    return any(not is_host_network(pod)"},{"line_number":679,"context_line":"               for pod in pods.get(\u0027items\u0027, []))"}],"source_content_type":"text/x-python","patch_set":11,"id":"2ab4f71b_7cc7ed49","line":679,"range":{"start_line":663,"start_character":0,"end_line":679,"end_character":48},"in_reply_to":"f1b5bced_57d74338","updated":"2021-10-24 12:03:02.000000000","message":"Done","commit_id":"fce199b4351bb99ee6d7db0f9a46d7a8c37c9918"}]}
