)]}'
{"kuryr_kubernetes/controller/handlers/namespace.py":[{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2921be670bee26870d393b4d74311c5bd0645cd2","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        if net_crd:"},{"line_number":82,"context_line":"            net_crd_annotations \u003d net_crd[\u0027metadata\u0027][\u0027annotations\u0027]"},{"line_number":83,"context_line":"            namespace_uid \u003d namespace[\u0027metadata\u0027][\u0027uid\u0027]"},{"line_number":84,"context_line":"            if namespace_uid !\u003d net_crd_annotations[\u0027namespaceUID\u0027]:"},{"line_number":85,"context_line":"                LOG.debug(\"Previous CRD existing at the new namespace.\")"},{"line_number":86,"context_line":"                raise exceptions.ResourceNotReady(namespace)"},{"line_number":87,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_d22a842a","line":84,"range":{"start_line":84,"start_character":32,"end_line":84,"end_character":67},"updated":"2019-06-24 08:17:07.000000000","message":"this should be in form .get(\"\"), in case we are getting CRD objects that did not include namespaceUID. In such case perhaps also worth to return ResourceNotReady exception","commit_id":"66efe7368281a4e09c33dc112ada1b8128aa982e"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2921be670bee26870d393b4d74311c5bd0645cd2","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        if net_crd:"},{"line_number":82,"context_line":"            net_crd_annotations \u003d net_crd[\u0027metadata\u0027][\u0027annotations\u0027]"},{"line_number":83,"context_line":"            namespace_uid \u003d namespace[\u0027metadata\u0027][\u0027uid\u0027]"},{"line_number":84,"context_line":"            if namespace_uid !\u003d net_crd_annotations[\u0027namespaceUID\u0027]:"},{"line_number":85,"context_line":"                LOG.debug(\"Previous CRD existing at the new namespace.\")"},{"line_number":86,"context_line":"                raise exceptions.ResourceNotReady(namespace)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        LOG.debug(\"Creating network resources for namespace: %s\", ns_name)"},{"line_number":89,"context_line":"        net_crd_spec \u003d self._drv_subnets.create_namespace_network(ns_name,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_921c0c14","line":86,"range":{"start_line":84,"start_character":0,"end_line":86,"end_character":60},"updated":"2019-06-24 08:17:07.000000000","message":"Should we also have an else clause handling that if both IDs match, then we simply need to annotate the namespace with this kuryrnet CRD and return None as namespace should be ready?","commit_id":"66efe7368281a4e09c33dc112ada1b8128aa982e"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"c952fb12a236f132011c302403be54a65f0df63b","unresolved":false,"context_lines":[{"line_number":114,"context_line":"            self._drv_subnets.rollback_network_resources(net_crd_spec, ns_name)"},{"line_number":115,"context_line":"            self._drv_sg.delete_sg(net_crd_sg[\u0027sgId\u0027])"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def on_deleted(self, namespace, net_crd\u003dNone):"},{"line_number":118,"context_line":"        LOG.debug(\"Deleting namespace: %s\", namespace)"},{"line_number":119,"context_line":"        if not net_crd:"},{"line_number":120,"context_line":"            net_crd_id \u003d self._get_net_crd_id(namespace)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_556b70b5","line":117,"range":{"start_line":117,"start_character":0,"end_line":117,"end_character":50},"updated":"2019-07-01 07:27:53.000000000","message":"this function (and on_added, on_modified) are the functions called by the ResourceEventHandler. I would leave them as they are, and then have another function that accepts the net_crd\u003dNone, being called by both your on_added and the on_deleted","commit_id":"c0065622f0ae74b3952644e08d71d6d02a1f3b51"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"e2c88c9fbe0341e5eec8278fe0c913c94520df23","unresolved":false,"context_lines":[{"line_number":114,"context_line":"            self._drv_subnets.rollback_network_resources(net_crd_spec, ns_name)"},{"line_number":115,"context_line":"            self._drv_sg.delete_sg(net_crd_sg[\u0027sgId\u0027])"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def on_deleted(self, namespace, net_crd\u003dNone):"},{"line_number":118,"context_line":"        LOG.debug(\"Deleting namespace: %s\", namespace)"},{"line_number":119,"context_line":"        if not net_crd:"},{"line_number":120,"context_line":"            net_crd_id \u003d self._get_net_crd_id(namespace)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_ae9616ef","line":117,"range":{"start_line":117,"start_character":0,"end_line":117,"end_character":50},"in_reply_to":"9fb8cfa7_556b70b5","updated":"2019-07-01 15:26:36.000000000","message":"Yup, I\u0027ve actually seen this pattern in Kuryr [1].\nDo you have any specific scenario in mind that would make the call of \u0027on_delete\u0027 on the \u0027on_present\u0027 method not be a good solution?\n\n[1] https://github.com/openstack/kuryr-kubernetes/blob/master/kuryr_kubernetes/controller/handlers/lbaas.py#L219","commit_id":"c0065622f0ae74b3952644e08d71d6d02a1f3b51"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"4db5876f99b4a837ea3bb6dd1adab371d54d543f","unresolved":false,"context_lines":[{"line_number":114,"context_line":"            self._drv_subnets.rollback_network_resources(net_crd_spec, ns_name)"},{"line_number":115,"context_line":"            self._drv_sg.delete_sg(net_crd_sg[\u0027sgId\u0027])"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def on_deleted(self, namespace, net_crd\u003dNone):"},{"line_number":118,"context_line":"        LOG.debug(\"Deleting namespace: %s\", namespace)"},{"line_number":119,"context_line":"        if not net_crd:"},{"line_number":120,"context_line":"            net_crd_id \u003d self._get_net_crd_id(namespace)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_1938c0d0","line":117,"range":{"start_line":117,"start_character":0,"end_line":117,"end_character":50},"in_reply_to":"9fb8cfa7_ae9616ef","updated":"2019-07-02 06:47:33.000000000","message":"ok, fine with me","commit_id":"c0065622f0ae74b3952644e08d71d6d02a1f3b51"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"c952fb12a236f132011c302403be54a65f0df63b","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                            namespace)"},{"line_number":124,"context_line":"                return"},{"line_number":125,"context_line":"            net_crd \u003d self._get_net_crd(net_crd_id)"},{"line_number":126,"context_line":"        else:"},{"line_number":127,"context_line":"            net_crd_id \u003d \u0027ns-\u0027 + namespace[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        self._set_kuryr_net_crd(net_crd, net_crd_id)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_d5ea000d","line":127,"range":{"start_line":126,"start_character":0,"end_line":127,"end_character":62},"updated":"2019-07-01 07:27:53.000000000","message":"if you arrive here from the call at line 85, the namespace is not supposed to have the net_crd_id, right? Plus, you are getting here the name not the id","commit_id":"c0065622f0ae74b3952644e08d71d6d02a1f3b51"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"ac644ae823af6003b3d78230756496d3b1bcf340","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                            namespace)"},{"line_number":124,"context_line":"                return"},{"line_number":125,"context_line":"            net_crd \u003d self._get_net_crd(net_crd_id)"},{"line_number":126,"context_line":"        else:"},{"line_number":127,"context_line":"            net_crd_id \u003d \u0027ns-\u0027 + namespace[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        self._set_kuryr_net_crd(net_crd, net_crd_id)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_41f5d6ec","line":127,"range":{"start_line":126,"start_character":0,"end_line":127,"end_character":62},"in_reply_to":"9fb8cfa7_d5ea000d","updated":"2019-07-02 18:56:43.000000000","message":"Yes, but the kuryrnet CRD left behind should be deleted later on.\nThe net_crd_id is composed by a prefix \u0027ns\u0027 and the name of the namespace.","commit_id":"c0065622f0ae74b3952644e08d71d6d02a1f3b51"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"c952fb12a236f132011c302403be54a65f0df63b","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        else:"},{"line_number":127,"context_line":"            net_crd_id \u003d \u0027ns-\u0027 + namespace[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        self._set_kuryr_net_crd(net_crd, net_crd_id)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        self._drv_vif_pool.delete_network_pools(net_crd[\u0027spec\u0027][\u0027netId\u0027])"},{"line_number":132,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_15b6583f","line":129,"range":{"start_line":129,"start_character":14,"end_line":129,"end_character":32},"updated":"2019-07-01 07:27:53.000000000","message":"this is not descriptive, setting what?\n\nAlso, not sure if that could end up blocking the execution. If you set the status to not active here, and any of the follow up calls fail (without ResourceNotReady being the exception), then it may happen that the next event to handle is the creation of the namespace (with the same name), and when the flow reaches the lines 84-86, as the CRD is not active, if just raise the ResourceNotReady exception, that will trigger another retry. This will go on and on until the kuryr-controller is restarted","commit_id":"c0065622f0ae74b3952644e08d71d6d02a1f3b51"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"e2c88c9fbe0341e5eec8278fe0c913c94520df23","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        else:"},{"line_number":127,"context_line":"            net_crd_id \u003d \u0027ns-\u0027 + namespace[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        self._set_kuryr_net_crd(net_crd, net_crd_id)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        self._drv_vif_pool.delete_network_pools(net_crd[\u0027spec\u0027][\u0027netId\u0027])"},{"line_number":132,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_4ec8ba53","line":129,"range":{"start_line":129,"start_character":14,"end_line":129,"end_character":32},"in_reply_to":"9fb8cfa7_15b6583f","updated":"2019-07-01 15:26:36.000000000","message":"You\u0027re completely right. Thanks for raising this!","commit_id":"c0065622f0ae74b3952644e08d71d6d02a1f3b51"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"e61348c516330a4eb4e6753c7e2427bd5c3e60b1","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        net_crd_id \u003d \u0027ns-\u0027 + ns_name"},{"line_number":80,"context_line":"        net_crd \u003d self._get_net_crd(net_crd_id)"},{"line_number":81,"context_line":"        if net_crd:"},{"line_number":82,"context_line":"            LOG.debug(\"Previous CRD existing at the new namespace\")"},{"line_number":83,"context_line":"            self.on_deleted(namespace, net_crd)"},{"line_number":84,"context_line":"            raise exceptions.ResourceNotReady(namespace)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_3fceb22d","line":82,"range":{"start_line":82,"start_character":12,"end_line":82,"end_character":67},"updated":"2019-07-03 07:00:22.000000000","message":"perhaps add information about that its deletion is going to be triggered and creation will be retried.","commit_id":"859fe62734ffd59feee92598b1a3aff7b7d6f132"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"eece10a654f6cf1807f8ec0d52d475d62b5aced4","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            LOG.debug(\"CRD existing at the new namespace\")"},{"line_number":77,"context_line":"            return"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        net_crd_id \u003d \u0027ns-\u0027 + ns_name"},{"line_number":80,"context_line":"        net_crd \u003d self._get_net_crd(net_crd_id)"},{"line_number":81,"context_line":"        if net_crd:"},{"line_number":82,"context_line":"            LOG.debug(\"Previous CRD existing at the new namespace. \""}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_61eecd89","line":79,"range":{"start_line":79,"start_character":7,"end_line":79,"end_character":19},"updated":"2019-07-04 08:41:47.000000000","message":"this is not the net_crd_id, right?","commit_id":"b546d364f910bd9480866797d6e811499fa716c0"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"9bfcc4c61bb212c584a391f7766cfca1e03fd02f","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        net_crd \u003d self._get_net_crd(net_crd_name)"},{"line_number":81,"context_line":"        if net_crd:"},{"line_number":82,"context_line":"            LOG.debug(\"Previous CRD existing at the new namespace. \""},{"line_number":83,"context_line":"                      \"Deleting namespace resources and retying its creation.\")"},{"line_number":84,"context_line":"            self.on_deleted(namespace, net_crd)"},{"line_number":85,"context_line":"            raise exceptions.ResourceNotReady(namespace)"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_bed03ff9","line":83,"range":{"start_line":83,"start_character":56,"end_line":83,"end_character":63},"updated":"2019-07-08 07:59:10.000000000","message":"retrying","commit_id":"37b8e3e6b37c7ffd3136a1fbefdd7bb0c1739f6e"}]}
