)]}'
{"kuryr_kubernetes/controller/drivers/network_policy.py":[{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"ee972bc1f7ce852daf5560b481033de0ddbbbee1","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        default_cidrs \u003d []"},{"line_number":136,"context_line":"        if CONF.octavia_defaults.enforce_sg_rules:"},{"line_number":137,"context_line":"            default_cidrs.append(utils.get_subnet_cidr("},{"line_number":138,"context_line":"                config.CONF.neutron_defaults.service_subnet))"},{"line_number":139,"context_line":"        worker_subnet_id \u003d CONF.pod_vif_nested.worker_nodes_subnet"},{"line_number":140,"context_line":"        if worker_subnet_id:"},{"line_number":141,"context_line":"            default_cidrs.append(utils.get_subnet_cidr(worker_subnet_id))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_fcb56dd1","line":138,"range":{"start_line":138,"start_character":16,"end_line":138,"end_character":28},"updated":"2019-10-21 07:14:29.000000000","message":"should be just CONF?","commit_id":"effab25d68bbaef4d59b4cd04a18eb2a5b90dbb9"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"0103c0ab918c0ca1b0c0031657521760d06a0942","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        default_cidrs \u003d []"},{"line_number":136,"context_line":"        if CONF.octavia_defaults.enforce_sg_rules:"},{"line_number":137,"context_line":"            default_cidrs.append(utils.get_subnet_cidr("},{"line_number":138,"context_line":"                config.CONF.neutron_defaults.service_subnet))"},{"line_number":139,"context_line":"        worker_subnet_id \u003d CONF.pod_vif_nested.worker_nodes_subnet"},{"line_number":140,"context_line":"        if worker_subnet_id:"},{"line_number":141,"context_line":"            default_cidrs.append(utils.get_subnet_cidr(worker_subnet_id))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_7c53bd6d","line":138,"range":{"start_line":138,"start_character":16,"end_line":138,"end_character":28},"in_reply_to":"3fa7e38b_fcb56dd1","updated":"2019-10-21 07:34:19.000000000","message":"Done","commit_id":"effab25d68bbaef4d59b4cd04a18eb2a5b90dbb9"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"ee972bc1f7ce852daf5560b481033de0ddbbbee1","unresolved":false,"context_lines":[{"line_number":585,"context_line":"            return sg_rule_body_list"},{"line_number":586,"context_line":""},{"line_number":587,"context_line":"        for service in services.get(\u0027items\u0027):"},{"line_number":588,"context_line":"            if self._is_pod(resource):"},{"line_number":589,"context_line":"                pod_labels \u003d resource[\u0027metadata\u0027].get(\u0027labels\u0027)"},{"line_number":590,"context_line":"                svc_selector \u003d service[\u0027spec\u0027].get(\u0027selector\u0027)"},{"line_number":591,"context_line":"                if not svc_selector or not pod_labels:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_5cc0412b","line":588,"range":{"start_line":588,"start_character":11,"end_line":588,"end_character":38},"updated":"2019-10-21 07:14:29.000000000","message":"should this \u0027if\u0027 be out of the for loop?","commit_id":"effab25d68bbaef4d59b4cd04a18eb2a5b90dbb9"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"0103c0ab918c0ca1b0c0031657521760d06a0942","unresolved":false,"context_lines":[{"line_number":585,"context_line":"            return sg_rule_body_list"},{"line_number":586,"context_line":""},{"line_number":587,"context_line":"        for service in services.get(\u0027items\u0027):"},{"line_number":588,"context_line":"            if self._is_pod(resource):"},{"line_number":589,"context_line":"                pod_labels \u003d resource[\u0027metadata\u0027].get(\u0027labels\u0027)"},{"line_number":590,"context_line":"                svc_selector \u003d service[\u0027spec\u0027].get(\u0027selector\u0027)"},{"line_number":591,"context_line":"                if not svc_selector or not pod_labels:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_fc76cd0c","line":588,"range":{"start_line":588,"start_character":11,"end_line":588,"end_character":38},"in_reply_to":"3fa7e38b_5cc0412b","updated":"2019-10-21 07:34:19.000000000","message":"I don\u0027t see a reason why. These conditions are in place to avoid the creation of the Egress rule for the current SVC. First it checks if the matched allowed resource by the Policy is a Pod and if it\u0027s selected by the SVC. Or if it\u0027s a namespace and matches the SVC namespace.\nDo you see any other case that might not be covered?","commit_id":"effab25d68bbaef4d59b4cd04a18eb2a5b90dbb9"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"b413e0ce42cfbf291ee44fe817dab4f68b7ea1fc","unresolved":false,"context_lines":[{"line_number":613,"context_line":"                    if (ipaddress.ip_address(pod_ip)"},{"line_number":614,"context_line":"                            in ipaddress.ip_network("},{"line_number":615,"context_line":"                                resource.get(\u0027cidr\u0027))):"},{"line_number":616,"context_line":"                        matched \u003d True"},{"line_number":617,"context_line":"                if not matched:"},{"line_number":618,"context_line":"                    continue"},{"line_number":619,"context_line":"            else:"},{"line_number":620,"context_line":"                ns_name \u003d service[\u0027metadata\u0027][\u0027namespace\u0027]"},{"line_number":621,"context_line":"                if ns_name !\u003d resource[\u0027metadata\u0027][\u0027name\u0027]:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_fc10c202","line":618,"range":{"start_line":616,"start_character":0,"end_line":618,"end_character":28},"updated":"2019-10-24 16:34:55.000000000","message":"what is this matched used for? is this meant to be indent inside the for loop of 611 and be if matched then break?","commit_id":"fa77abbe25ab7ad1f0bbdeb6cf42839016b16a69"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"7316d1f2b983a198ebcb365445e8c8f001d2900a","unresolved":false,"context_lines":[{"line_number":613,"context_line":"                    if (ipaddress.ip_address(pod_ip)"},{"line_number":614,"context_line":"                            in ipaddress.ip_network("},{"line_number":615,"context_line":"                                resource.get(\u0027cidr\u0027))):"},{"line_number":616,"context_line":"                        matched \u003d True"},{"line_number":617,"context_line":"                if not matched:"},{"line_number":618,"context_line":"                    continue"},{"line_number":619,"context_line":"            else:"},{"line_number":620,"context_line":"                ns_name \u003d service[\u0027metadata\u0027][\u0027namespace\u0027]"},{"line_number":621,"context_line":"                if ns_name !\u003d resource[\u0027metadata\u0027][\u0027name\u0027]:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_bd155a4b","line":618,"range":{"start_line":616,"start_character":0,"end_line":618,"end_character":28},"in_reply_to":"3fa7e38b_dd1296b4","updated":"2019-10-25 10:05:14.000000000","message":"right... I was not thinking about ipblock here, and due to indentation I didn\u0027t see that it is actually skipping lines 623-629 if there is no match","commit_id":"fa77abbe25ab7ad1f0bbdeb6cf42839016b16a69"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"8f10886a8c58e9655671c77a825c51ae8e281e8a","unresolved":false,"context_lines":[{"line_number":613,"context_line":"                    if (ipaddress.ip_address(pod_ip)"},{"line_number":614,"context_line":"                            in ipaddress.ip_network("},{"line_number":615,"context_line":"                                resource.get(\u0027cidr\u0027))):"},{"line_number":616,"context_line":"                        matched \u003d True"},{"line_number":617,"context_line":"                if not matched:"},{"line_number":618,"context_line":"                    continue"},{"line_number":619,"context_line":"            else:"},{"line_number":620,"context_line":"                ns_name \u003d service[\u0027metadata\u0027][\u0027namespace\u0027]"},{"line_number":621,"context_line":"                if ns_name !\u003d resource[\u0027metadata\u0027][\u0027name\u0027]:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_dd1296b4","line":618,"range":{"start_line":616,"start_character":0,"end_line":618,"end_character":28},"in_reply_to":"3fa7e38b_fc10c202","updated":"2019-10-25 09:43:28.000000000","message":"In case a \u0027cidr\u0027 is defined at the resource object this means an IPBlock rule is specified at the Network Policy. So, if the Service has the same namespace as the Policy and some backend pod of the SVC is in the IPBlock range a SG rule to that SVC should be created. Otherwise the SG rule creation should be skipped.\n\nPerhaps I can extract that code fragment(line 604-616) to another function and return as soon as a pod matches an IPBlock.","commit_id":"fa77abbe25ab7ad1f0bbdeb6cf42839016b16a69"}]}
