)]}'
{"doc/source/installation/network_policy.rst":[{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"e98a2404cd9e570e272ee7c4177ab0307493447a","unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"      $ kubectl get kuryrnetworkpolicy test-network-policy -o yaml"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"      apiVersion: openstack.org/v1"},{"line_number":164,"context_line":"      kind: KuryrNetPolicy"},{"line_number":165,"context_line":"      metadata:"},{"line_number":166,"context_line":"        annotations:"},{"line_number":167,"context_line":"          networkpolicy_name: test-network-policy"},{"line_number":168,"context_line":"          networkpolicy_namespace: default"},{"line_number":169,"context_line":"          networkpolicy_uid: aee1c59f-c634-11e8-b63d-002564fdd760"},{"line_number":170,"context_line":"        clusterName: \"\""},{"line_number":171,"context_line":"        creationTimestamp: 2018-10-02T11:17:02Z"},{"line_number":172,"context_line":"        generation: 0"},{"line_number":173,"context_line":"        name: np-test-network-policy"},{"line_number":174,"context_line":"        namespace: default"},{"line_number":175,"context_line":"        resourceVersion: \"2117\""},{"line_number":176,"context_line":"        selfLink: /apis/openstack.org/v1/namespaces/default/kuryrnetpolicies/np-test-network-policy"},{"line_number":177,"context_line":"        uid: afb99326-c634-11e8-b63d-002564fdd760"},{"line_number":178,"context_line":"      spec:"},{"line_number":179,"context_line":"        egressSgRules:"},{"line_number":180,"context_line":"        - security_group_rule:"},{"line_number":181,"context_line":"            description: Kuryr-Kubernetes NetPolicy SG rule"},{"line_number":182,"context_line":"            direction: egress"},{"line_number":183,"context_line":"            ethertype: IPv4"},{"line_number":184,"context_line":"            id: 6297c198-b385-44f3-8b43-29951f933a8f"},{"line_number":185,"context_line":"            port_range_max: 5978"},{"line_number":186,"context_line":"            port_range_min: 5978"},{"line_number":187,"context_line":"            protocol: tcp"},{"line_number":188,"context_line":"            security_group_id: cdee7815-3b49-4a3e-abc8-31e384ab75c5"},{"line_number":189,"context_line":"        ingressSgRules:"},{"line_number":190,"context_line":"        - security_group_rule:"},{"line_number":191,"context_line":"            description: Kuryr-Kubernetes NetPolicy SG rule"},{"line_number":192,"context_line":"            direction: ingress"},{"line_number":193,"context_line":"            ethertype: IPv4"},{"line_number":194,"context_line":"            id: f4e11e73-81c6-4c1b-9760-714eedff417b"},{"line_number":195,"context_line":"            port_range_max: 6379"},{"line_number":196,"context_line":"            port_range_min: 6379"},{"line_number":197,"context_line":"            protocol: tcp"},{"line_number":198,"context_line":"            security_group_id: cdee7815-3b49-4a3e-abc8-31e384ab75c5"},{"line_number":199,"context_line":"        securityGroupId: cdee7815-3b49-4a3e-abc8-31e384ab75c5"},{"line_number":200,"context_line":"        securityGroupName: sg-test-network-policy"},{"line_number":201,"context_line":"        networkpolicy_spec:"},{"line_number":202,"context_line":"          egress:"},{"line_number":203,"context_line":"          - to:"},{"line_number":204,"context_line":"            - namespaceSelector:"},{"line_number":205,"context_line":"                matchLabels:"},{"line_number":206,"context_line":"                  project: default"},{"line_number":207,"context_line":"            ports:"},{"line_number":208,"context_line":"            - port: 5978"},{"line_number":209,"context_line":"              protocol: TCP"},{"line_number":210,"context_line":"          ingress:"},{"line_number":211,"context_line":"          - from:"},{"line_number":212,"context_line":"            - namespaceSelector:"},{"line_number":213,"context_line":"                matchLabels:"},{"line_number":214,"context_line":"                  project: default"},{"line_number":215,"context_line":"            ports:"},{"line_number":216,"context_line":"            - port: 6379"},{"line_number":217,"context_line":"              protocol: TCP"},{"line_number":218,"context_line":"          podSelector:"},{"line_number":219,"context_line":"            matchLabels:"},{"line_number":220,"context_line":"              project: default"},{"line_number":221,"context_line":"          policyTypes:"},{"line_number":222,"context_line":"          - Ingress"},{"line_number":223,"context_line":"          - Egress"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"      $ openstack security group rule list sg-test-network-policy --protocol tcp -c \"IP Protocol\" -c \"Port Range\" -c \"Direction\" --long"}],"source_content_type":"text/x-rst","patch_set":1,"id":"3f4c43b2_1072ff11","line":222,"range":{"start_line":163,"start_character":0,"end_line":222,"end_character":19},"updated":"2020-04-28 17:20:12.000000000","message":"This should be updated to match the new format.","commit_id":"9466c6ce68d8e67bd62d5647af2e42196c83b1cc"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"e98a2404cd9e570e272ee7c4177ab0307493447a","unresolved":false,"context_lines":[{"line_number":274,"context_line":"      networkpolicy \"test-network-policy\" patched"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"      $ kubectl get knp test-network-policy -o yaml"},{"line_number":277,"context_line":"      apiVersion: openstack.org/v1"},{"line_number":278,"context_line":"      kind: KuryrNetPolicy"},{"line_number":279,"context_line":"      metadata:"},{"line_number":280,"context_line":"        annotations:"},{"line_number":281,"context_line":"          networkpolicy_name: test-network-policy"},{"line_number":282,"context_line":"          networkpolicy_namespace: default"},{"line_number":283,"context_line":"          networkpolicy_uid: aee1c59f-c634-11e8-b63d-002564fdd760"},{"line_number":284,"context_line":"        clusterName: \"\""},{"line_number":285,"context_line":"        creationTimestamp: 2018-10-02T11:17:02Z"},{"line_number":286,"context_line":"        generation: 0"},{"line_number":287,"context_line":"        name: np-test-network-policy"},{"line_number":288,"context_line":"        namespace: default"},{"line_number":289,"context_line":"        resourceVersion: \"1546\""},{"line_number":290,"context_line":"        selfLink: /apis/openstack.org/v1/namespaces/default/kuryrnetpolicies/np-test-network-policy"},{"line_number":291,"context_line":"        uid: afb99326-c634-11e8-b63d-002564fdd760"},{"line_number":292,"context_line":"      spec:"},{"line_number":293,"context_line":"        egressSgRules:"},{"line_number":294,"context_line":"        - security_group_rule:"},{"line_number":295,"context_line":"            description: Kuryr-Kubernetes NetPolicy SG rule"},{"line_number":296,"context_line":"            direction: egress"},{"line_number":297,"context_line":"            ethertype: IPv4"},{"line_number":298,"context_line":"            id: 1969a0b3-55e1-43d7-ba16-005b4ed4cbb7"},{"line_number":299,"context_line":"            port_range_max: 5978"},{"line_number":300,"context_line":"            port_range_min: 5978"},{"line_number":301,"context_line":"            protocol: tcp"},{"line_number":302,"context_line":"            security_group_id: cdee7815-3b49-4a3e-abc8-31e384ab75c5"},{"line_number":303,"context_line":"        ingressSgRules:"},{"line_number":304,"context_line":"        - security_group_rule:"},{"line_number":305,"context_line":"            description: Kuryr-Kubernetes NetPolicy SG rule"},{"line_number":306,"context_line":"            direction: ingress"},{"line_number":307,"context_line":"            ethertype: IPv4"},{"line_number":308,"context_line":"            id: 6598aa1f-4f94-4fb2-81ce-d3649ba28f33"},{"line_number":309,"context_line":"            port_range_max: 8080"},{"line_number":310,"context_line":"            port_range_min: 8080"},{"line_number":311,"context_line":"            protocol: tcp"},{"line_number":312,"context_line":"            security_group_id: cdee7815-3b49-4a3e-abc8-31e384ab75c5"},{"line_number":313,"context_line":"        securityGroupId: cdee7815-3b49-4a3e-abc8-31e384ab75c5"},{"line_number":314,"context_line":"        networkpolicy_spec:"},{"line_number":315,"context_line":"          egress:"},{"line_number":316,"context_line":"          - ports:"},{"line_number":317,"context_line":"            - port: 5978"},{"line_number":318,"context_line":"              protocol: TCP"},{"line_number":319,"context_line":"            to:"},{"line_number":320,"context_line":"            - namespaceSelector:"},{"line_number":321,"context_line":"                matchLabels:"},{"line_number":322,"context_line":"                  project: default"},{"line_number":323,"context_line":"          ingress:"},{"line_number":324,"context_line":"          - ports:"},{"line_number":325,"context_line":"            - port: 8080"},{"line_number":326,"context_line":"              protocol: TCP"},{"line_number":327,"context_line":"            from:"},{"line_number":328,"context_line":"            - namespaceSelector:"},{"line_number":329,"context_line":"                matchLabels:"},{"line_number":330,"context_line":"                  project: default"},{"line_number":331,"context_line":"          podSelector:"},{"line_number":332,"context_line":"            matchLabels:"},{"line_number":333,"context_line":"              project: default"},{"line_number":334,"context_line":"          policyTypes:"},{"line_number":335,"context_line":"          - Ingress"},{"line_number":336,"context_line":"          - Egress"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"      $ openstack security group rule list sg-test-network-policy -c \"IP Protocol\" -c \"Port Range\" -c \"Direction\" --long"},{"line_number":339,"context_line":"      +-------------+------------+-----------+"}],"source_content_type":"text/x-rst","patch_set":1,"id":"3f4c43b2_905f2f71","line":336,"range":{"start_line":277,"start_character":0,"end_line":336,"end_character":18},"updated":"2020-04-28 17:20:12.000000000","message":"ditto","commit_id":"9466c6ce68d8e67bd62d5647af2e42196c83b1cc"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        clusterName: \"\""},{"line_number":171,"context_line":"        creationTimestamp: 2018-10-02T11:17:02Z"},{"line_number":172,"context_line":"        generation: 0"},{"line_number":173,"context_line":"        name: np-test-network-policy"},{"line_number":174,"context_line":"        namespace: default"},{"line_number":175,"context_line":"        resourceVersion: \"2117\""},{"line_number":176,"context_line":"        selfLink: /apis/openstack.org/v1/namespaces/default/kuryrnetpolicies/np-test-network-policy"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3f4c43b2_04160ca9","line":173,"range":{"start_line":173,"start_character":14,"end_line":173,"end_character":36},"updated":"2020-04-21 08:55:14.000000000","message":"drop np-","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        clusterName: \"\""},{"line_number":171,"context_line":"        creationTimestamp: 2018-10-02T11:17:02Z"},{"line_number":172,"context_line":"        generation: 0"},{"line_number":173,"context_line":"        name: np-test-network-policy"},{"line_number":174,"context_line":"        namespace: default"},{"line_number":175,"context_line":"        resourceVersion: \"2117\""},{"line_number":176,"context_line":"        selfLink: /apis/openstack.org/v1/namespaces/default/kuryrnetpolicies/np-test-network-policy"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1f493fa4_5680488c","line":173,"range":{"start_line":173,"start_character":14,"end_line":173,"end_character":36},"in_reply_to":"3f4c43b2_04160ca9","updated":"2020-04-23 15:41:36.000000000","message":"I need to fully update it anyway, this is old structure.","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        clusterName: \"\""},{"line_number":285,"context_line":"        creationTimestamp: 2018-10-02T11:17:02Z"},{"line_number":286,"context_line":"        generation: 0"},{"line_number":287,"context_line":"        name: np-test-network-policy"},{"line_number":288,"context_line":"        namespace: default"},{"line_number":289,"context_line":"        resourceVersion: \"1546\""},{"line_number":290,"context_line":"        selfLink: /apis/openstack.org/v1/namespaces/default/kuryrnetpolicies/np-test-network-policy"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3f4c43b2_84297ce7","line":287,"range":{"start_line":287,"start_character":13,"end_line":287,"end_character":36},"updated":"2020-04-21 08:55:14.000000000","message":"drop np-","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        clusterName: \"\""},{"line_number":285,"context_line":"        creationTimestamp: 2018-10-02T11:17:02Z"},{"line_number":286,"context_line":"        generation: 0"},{"line_number":287,"context_line":"        name: np-test-network-policy"},{"line_number":288,"context_line":"        namespace: default"},{"line_number":289,"context_line":"        resourceVersion: \"1546\""},{"line_number":290,"context_line":"        selfLink: /apis/openstack.org/v1/namespaces/default/kuryrnetpolicies/np-test-network-policy"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1f493fa4_367dbcb1","line":287,"range":{"start_line":287,"start_character":13,"end_line":287,"end_character":36},"in_reply_to":"3f4c43b2_84297ce7","updated":"2020-04-23 15:41:36.000000000","message":"Same.","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4067ac68d8b415afd0d0728e25de99e2f76104e2","unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"      $ kubectl get kuryrnetworkpolicy test-network-policy -o yaml"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"      apiVersion: openstack.org/v1"},{"line_number":164,"context_line":"      kind: KuryrNetPolicy"},{"line_number":165,"context_line":"      metadata:"},{"line_number":166,"context_line":"        annotations:"},{"line_number":167,"context_line":"          networkpolicy_name: test-network-policy"},{"line_number":168,"context_line":"          networkpolicy_namespace: default"},{"line_number":169,"context_line":"          networkpolicy_uid: aee1c59f-c634-11e8-b63d-002564fdd760"},{"line_number":170,"context_line":"        clusterName: \"\""},{"line_number":171,"context_line":"        creationTimestamp: 2018-10-02T11:17:02Z"},{"line_number":172,"context_line":"        generation: 0"},{"line_number":173,"context_line":"        name: np-test-network-policy"},{"line_number":174,"context_line":"        namespace: default"},{"line_number":175,"context_line":"        resourceVersion: \"2117\""},{"line_number":176,"context_line":"        selfLink: /apis/openstack.org/v1/namespaces/default/kuryrnetpolicies/np-test-network-policy"},{"line_number":177,"context_line":"        uid: afb99326-c634-11e8-b63d-002564fdd760"},{"line_number":178,"context_line":"      spec:"},{"line_number":179,"context_line":"        egressSgRules:"},{"line_number":180,"context_line":"        - security_group_rule:"},{"line_number":181,"context_line":"            description: Kuryr-Kubernetes NetPolicy SG rule"},{"line_number":182,"context_line":"            direction: egress"},{"line_number":183,"context_line":"            ethertype: IPv4"},{"line_number":184,"context_line":"            id: 6297c198-b385-44f3-8b43-29951f933a8f"},{"line_number":185,"context_line":"            port_range_max: 5978"},{"line_number":186,"context_line":"            port_range_min: 5978"},{"line_number":187,"context_line":"            protocol: tcp"},{"line_number":188,"context_line":"            security_group_id: cdee7815-3b49-4a3e-abc8-31e384ab75c5"},{"line_number":189,"context_line":"        ingressSgRules:"},{"line_number":190,"context_line":"        - security_group_rule:"},{"line_number":191,"context_line":"            description: Kuryr-Kubernetes NetPolicy SG rule"},{"line_number":192,"context_line":"            direction: ingress"},{"line_number":193,"context_line":"            ethertype: IPv4"},{"line_number":194,"context_line":"            id: f4e11e73-81c6-4c1b-9760-714eedff417b"},{"line_number":195,"context_line":"            port_range_max: 6379"},{"line_number":196,"context_line":"            port_range_min: 6379"},{"line_number":197,"context_line":"            protocol: tcp"},{"line_number":198,"context_line":"            security_group_id: cdee7815-3b49-4a3e-abc8-31e384ab75c5"},{"line_number":199,"context_line":"        securityGroupId: cdee7815-3b49-4a3e-abc8-31e384ab75c5"},{"line_number":200,"context_line":"        securityGroupName: sg-test-network-policy"},{"line_number":201,"context_line":"        networkpolicy_spec:"},{"line_number":202,"context_line":"          egress:"},{"line_number":203,"context_line":"          - to:"},{"line_number":204,"context_line":"            - namespaceSelector:"},{"line_number":205,"context_line":"                matchLabels:"},{"line_number":206,"context_line":"                  project: default"},{"line_number":207,"context_line":"            ports:"},{"line_number":208,"context_line":"            - port: 5978"},{"line_number":209,"context_line":"              protocol: TCP"},{"line_number":210,"context_line":"          ingress:"},{"line_number":211,"context_line":"          - from:"},{"line_number":212,"context_line":"            - namespaceSelector:"},{"line_number":213,"context_line":"                matchLabels:"},{"line_number":214,"context_line":"                  project: default"},{"line_number":215,"context_line":"            ports:"},{"line_number":216,"context_line":"            - port: 6379"},{"line_number":217,"context_line":"              protocol: TCP"},{"line_number":218,"context_line":"          podSelector:"},{"line_number":219,"context_line":"            matchLabels:"},{"line_number":220,"context_line":"              project: default"},{"line_number":221,"context_line":"          policyTypes:"},{"line_number":222,"context_line":"          - Ingress"},{"line_number":223,"context_line":"          - Egress"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"      $ openstack security group rule list sg-test-network-policy --protocol tcp -c \"IP Protocol\" -c \"Port Range\" -c \"Direction\" --long"},{"line_number":226,"context_line":"      +-------------+------------+-----------+"}],"source_content_type":"text/x-rst","patch_set":11,"id":"bf51134e_ed105852","line":223,"range":{"start_line":163,"start_character":0,"end_line":223,"end_character":18},"updated":"2020-07-22 22:19:25.000000000","message":"This might need update as the CRD format was updated to have status and spec.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"}],"kubernetes_crds/kuryr_crds/kuryrnetworkpolicy.yaml":[{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                  required:"},{"line_number":46,"context_line":"                  - security_group_rule"},{"line_number":47,"context_line":"                  properties:"},{"line_number":48,"context_line":"                    remote_ip_prefixes:"},{"line_number":49,"context_line":"                      type: object"},{"line_number":50,"context_line":"                    namespace:"},{"line_number":51,"context_line":"                      type: string"},{"line_number":52,"context_line":"                    security_group_rule:"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"1f493fa4_ce3cc6c1","line":49,"range":{"start_line":48,"start_character":0,"end_line":49,"end_character":34},"updated":"2020-04-21 08:55:14.000000000","message":"this is also repeated at line 67-68, I suppose we copy it twice because it is handy. And because the others are not mandatory","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                  required:"},{"line_number":46,"context_line":"                  - security_group_rule"},{"line_number":47,"context_line":"                  properties:"},{"line_number":48,"context_line":"                    remote_ip_prefixes:"},{"line_number":49,"context_line":"                      type: object"},{"line_number":50,"context_line":"                    namespace:"},{"line_number":51,"context_line":"                      type: string"},{"line_number":52,"context_line":"                    security_group_rule:"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"1f493fa4_d613b865","line":49,"range":{"start_line":48,"start_character":0,"end_line":49,"end_character":34},"in_reply_to":"1f493fa4_ce3cc6c1","updated":"2020-04-23 15:41:36.000000000","message":"Nice, now I know I\u0027m not the only one not fully understanding this until going over all the code. :D\n\nOkay, so this is remote_ip_prefixes, a field used along with namespace to later on have easy access to all the pods this rule affected. remote_ip_prefix below is used directly in SG definition.\n\nMy plan was to rename remote_ip_prefixes and namespace into some structure like affectedPods, but wanted to do it on another patch (let\u0027s assume we won\u0027t upgrade between them so that I can make non-backward compatible changes here).","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"5119bd73e0ed607f2641e3d6661e4dd2baedb3f5","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                  required:"},{"line_number":46,"context_line":"                  - security_group_rule"},{"line_number":47,"context_line":"                  properties:"},{"line_number":48,"context_line":"                    remote_ip_prefixes:"},{"line_number":49,"context_line":"                      type: object"},{"line_number":50,"context_line":"                    namespace:"},{"line_number":51,"context_line":"                      type: string"},{"line_number":52,"context_line":"                    security_group_rule:"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"1f493fa4_b864cee6","line":49,"range":{"start_line":48,"start_character":0,"end_line":49,"end_character":34},"in_reply_to":"1f493fa4_d613b865","updated":"2020-04-24 07:20:31.000000000","message":"ohh, right! thanks","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"e98a2404cd9e570e272ee7c4177ab0307493447a","unresolved":false,"context_lines":[{"line_number":111,"context_line":"              securityGroupRules:"},{"line_number":112,"context_line":"                type: array"},{"line_number":113,"context_line":"                items:"},{"line_number":114,"context_line":"                  type: object"},{"line_number":115,"context_line":"                  properties:"},{"line_number":116,"context_line":"                    id:"},{"line_number":117,"context_line":"                      type: string"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"1f493fa4_e7e02929","line":114,"range":{"start_line":114,"start_character":18,"end_line":114,"end_character":30},"updated":"2020-04-28 17:20:12.000000000","message":"It might be good to ensure the id is a required field on the security group rule object.","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"0554c5fc25269f6cf20c3ff53c81b2d467edd559","unresolved":false,"context_lines":[{"line_number":111,"context_line":"              securityGroupRules:"},{"line_number":112,"context_line":"                type: array"},{"line_number":113,"context_line":"                items:"},{"line_number":114,"context_line":"                  type: object"},{"line_number":115,"context_line":"                  properties:"},{"line_number":116,"context_line":"                    id:"},{"line_number":117,"context_line":"                      type: string"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"bf51134e_658323cc","line":114,"range":{"start_line":114,"start_character":18,"end_line":114,"end_character":30},"in_reply_to":"1f493fa4_e7e02929","updated":"2020-07-16 14:44:17.000000000","message":"Done","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"}],"kuryr_kubernetes/constants.py":[{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":65,"context_line":"K8S_ANNOTATION_CURRENT_DRIVER \u003d \u0027current_driver\u0027"},{"line_number":66,"context_line":"K8S_ANNOTATION_NEUTRON_PORT \u003d \u0027neutron_id\u0027"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"KURYRNETWORK_FINALIZER \u003d \u0027kuryrnetwork.finalizers.kuryr.openstack.org\u0027"},{"line_number":69,"context_line":"NETWORKPOLICY_FINALIZER \u003d \u0027kuryr.openstack.org/networkpolicy-finalizer\u0027"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"K8S_OS_VIF_NOOP_PLUGIN \u003d \"noop\""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_2e91ea9a","line":68,"range":{"start_line":68,"start_character":0,"end_line":68,"end_character":70},"updated":"2020-04-21 08:55:14.000000000","message":"should we switch this too on this PS to have the same format?","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":65,"context_line":"K8S_ANNOTATION_CURRENT_DRIVER \u003d \u0027current_driver\u0027"},{"line_number":66,"context_line":"K8S_ANNOTATION_NEUTRON_PORT \u003d \u0027neutron_id\u0027"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"KURYRNETWORK_FINALIZER \u003d \u0027kuryrnetwork.finalizers.kuryr.openstack.org\u0027"},{"line_number":69,"context_line":"NETWORKPOLICY_FINALIZER \u003d \u0027kuryr.openstack.org/networkpolicy-finalizer\u0027"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"K8S_OS_VIF_NOOP_PLUGIN \u003d \"noop\""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_81fe0c03","line":68,"range":{"start_line":68,"start_character":0,"end_line":68,"end_character":70},"in_reply_to":"1f493fa4_2e91ea9a","updated":"2020-04-23 15:41:36.000000000","message":"To me this ship had failed, we\u0027ll need to do it in backward-compatible way if we want it.","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"}],"kuryr_kubernetes/controller/drivers/base.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"2d3280fc88e5cc69b419e11100e562798aeff4ee","unresolved":false,"context_lines":[{"line_number":731,"context_line":"        raise NotImplementedError()"},{"line_number":732,"context_line":""},{"line_number":733,"context_line":""},{"line_number":734,"context_line":"    @abc.abstractmethod"},{"line_number":735,"context_line":"    def namespaced_pods(self, policy):"},{"line_number":736,"context_line":"        \"\"\"Return pods on the policy namespace"},{"line_number":737,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4c43b2_fcd5ace6","line":734,"updated":"2020-04-16 17:56:35.000000000","message":"pep8: E303 too many blank lines (2)","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":731,"context_line":"        raise NotImplementedError()"},{"line_number":732,"context_line":""},{"line_number":733,"context_line":""},{"line_number":734,"context_line":"    @abc.abstractmethod"},{"line_number":735,"context_line":"    def namespaced_pods(self, policy):"},{"line_number":736,"context_line":"        \"\"\"Return pods on the policy namespace"},{"line_number":737,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_8ef75ef6","line":734,"in_reply_to":"3f4c43b2_fcd5ace6","updated":"2020-04-21 08:55:14.000000000","message":"nice to have zuul adding pep8 comments!","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"}],"kuryr_kubernetes/controller/drivers/network_policy.py":[{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"e98a2404cd9e570e272ee7c4177ab0307493447a","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        if not knp:"},{"line_number":61,"context_line":"            self._create_knp_crd(policy, i_rules, e_rules)"},{"line_number":62,"context_line":"        else:"},{"line_number":63,"context_line":"            self._patch_knp_crd(policy, i_rules, e_rules, knp\u003dknp)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def get_from_old_crd(self, netpolicy):"},{"line_number":66,"context_line":"        knp \u003d {"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_4cf1426b","line":63,"range":{"start_line":63,"start_character":12,"end_line":63,"end_character":66},"updated":"2020-04-28 17:20:12.000000000","message":"seems the CRD will always be present when this method is executed, perhaps we could removed the optional parameter?","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"0554c5fc25269f6cf20c3ff53c81b2d467edd559","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        if not knp:"},{"line_number":61,"context_line":"            self._create_knp_crd(policy, i_rules, e_rules)"},{"line_number":62,"context_line":"        else:"},{"line_number":63,"context_line":"            self._patch_knp_crd(policy, i_rules, e_rules, knp\u003dknp)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def get_from_old_crd(self, netpolicy):"},{"line_number":66,"context_line":"        knp \u003d {"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_85e757ac","line":63,"range":{"start_line":63,"start_character":12,"end_line":63,"end_character":66},"in_reply_to":"1f493fa4_4cf1426b","updated":"2020-07-16 14:44:17.000000000","message":"Done","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":602,"context_line":""},{"line_number":603,"context_line":"    def _create_knp_crd(self, policy, i_rules, e_rules):"},{"line_number":604,"context_line":"        networkpolicy_name \u003d policy[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":605,"context_line":"        netpolicy_crd_name \u003d networkpolicy_name"},{"line_number":606,"context_line":"        namespace \u003d policy[\u0027metadata\u0027][\u0027namespace\u0027]"},{"line_number":607,"context_line":"        pod_selector \u003d policy[\u0027spec\u0027].get(\u0027podSelector\u0027)"},{"line_number":608,"context_line":"        policy_types \u003d policy[\u0027spec\u0027].get(\u0027policyTypes\u0027, [])"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_6ea012a7","line":605,"range":{"start_line":605,"start_character":8,"end_line":605,"end_character":47},"updated":"2020-04-21 08:55:14.000000000","message":"why not use networkpolicy_name instead? now we are not adding the extra np-","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":602,"context_line":""},{"line_number":603,"context_line":"    def _create_knp_crd(self, policy, i_rules, e_rules):"},{"line_number":604,"context_line":"        networkpolicy_name \u003d policy[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":605,"context_line":"        netpolicy_crd_name \u003d networkpolicy_name"},{"line_number":606,"context_line":"        namespace \u003d policy[\u0027metadata\u0027][\u0027namespace\u0027]"},{"line_number":607,"context_line":"        pod_selector \u003d policy[\u0027spec\u0027].get(\u0027podSelector\u0027)"},{"line_number":608,"context_line":"        policy_types \u003d policy[\u0027spec\u0027].get(\u0027policyTypes\u0027, [])"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_a10d0839","line":605,"range":{"start_line":605,"start_character":8,"end_line":605,"end_character":47},"in_reply_to":"1f493fa4_6ea012a7","updated":"2020-04-23 15:41:36.000000000","message":"True…","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":642,"context_line":""},{"line_number":643,"context_line":"    def _patch_knp_crd(self, policy, i_rules, e_rules, knp\u003dNone):"},{"line_number":644,"context_line":"        networkpolicy_name \u003d policy[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":645,"context_line":"        netpolicy_crd_name \u003d networkpolicy_name"},{"line_number":646,"context_line":"        namespace \u003d policy[\u0027metadata\u0027][\u0027namespace\u0027]"},{"line_number":647,"context_line":"        pod_selector \u003d policy[\u0027spec\u0027].get(\u0027podSelector\u0027)"},{"line_number":648,"context_line":"        url \u003d (f\u0027{constants.K8S_API_CRD_NAMESPACES}/{namespace}\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_aeaa1a82","line":645,"range":{"start_line":645,"start_character":7,"end_line":645,"end_character":47},"updated":"2020-04-21 08:55:14.000000000","message":"ditto","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4067ac68d8b415afd0d0728e25de99e2f76104e2","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        security groups and security group rules are created or updated in"},{"line_number":46,"context_line":"        reaction to kubernetes network policies events."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        In addition it returns the pods affected by the policy:"},{"line_number":49,"context_line":"        - Creation: pods on the namespace of the created policy"},{"line_number":50,"context_line":"        - Update: pods that needs to be updated in case of PodSelector"},{"line_number":51,"context_line":"        modification, i.e., the pods that were affected by the previous"},{"line_number":52,"context_line":"        PodSelector"},{"line_number":53,"context_line":"        \"\"\""},{"line_number":54,"context_line":"        LOG.debug(\"Creating network policy %s\", policy[\u0027metadata\u0027][\u0027name\u0027])"},{"line_number":55,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_cda75409","line":52,"range":{"start_line":48,"start_character":0,"end_line":52,"end_character":19},"updated":"2020-07-22 22:19:25.000000000","message":"This needs update as no affected pod is returned anymore.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4067ac68d8b415afd0d0728e25de99e2f76104e2","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        return knp"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def _get_security_group_rules_from_network_policy(self, policy):"},{"line_number":93,"context_line":"        \"\"\"Create security group rules"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        This method creates the security group rules coming out of a network"},{"line_number":96,"context_line":"        policies\u0027 parsing."}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_6de72848","line":93,"range":{"start_line":93,"start_character":18,"end_line":93,"end_character":38},"updated":"2020-07-22 22:19:25.000000000","message":"perhaps this can be updated to something in the lines of: create security group rule bodies/specification?","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4067ac68d8b415afd0d0728e25de99e2f76104e2","unresolved":false,"context_lines":[{"line_number":666,"context_line":"        if not knp or knp[\u0027spec\u0027].get(\u0027podSelector\u0027) !\u003d pod_selector:"},{"line_number":667,"context_line":"            data[\u0027podSelector\u0027] \u003d pod_selector"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"        self.kubernetes.patch_crd(\u0027spec\u0027, url, data)"},{"line_number":670,"context_line":""},{"line_number":671,"context_line":"    def _del_knp_crd(self, netpolicy_crd):"},{"line_number":672,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_0d678cb9","line":669,"range":{"start_line":669,"start_character":8,"end_line":669,"end_character":52},"updated":"2020-07-22 22:19:25.000000000","message":"should we retry in case of any k8s api failures?","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"91a08fc43640e528b834163d08825a7f49f10871","unresolved":false,"context_lines":[{"line_number":666,"context_line":"        if not knp or knp[\u0027spec\u0027].get(\u0027podSelector\u0027) !\u003d pod_selector:"},{"line_number":667,"context_line":"            data[\u0027podSelector\u0027] \u003d pod_selector"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"        self.kubernetes.patch_crd(\u0027spec\u0027, url, data)"},{"line_number":670,"context_line":""},{"line_number":671,"context_line":"    def _del_knp_crd(self, netpolicy_crd):"},{"line_number":672,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_16d5d01b","line":669,"range":{"start_line":669,"start_character":8,"end_line":669,"end_character":52},"in_reply_to":"bf51134e_0d678cb9","updated":"2020-07-23 09:06:17.000000000","message":"Hm, I\u0027m not sure how to handle that, should we retry all the K8s calls anywhere? If so we\u0027d just need to add K8s errors to RetryHandler. I think I\u0027d rather just let reconciliation handle this.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"e8374b1dc62c85aa849c63a686483e9d89fc4630","unresolved":false,"context_lines":[{"line_number":666,"context_line":"        if not knp or knp[\u0027spec\u0027].get(\u0027podSelector\u0027) !\u003d pod_selector:"},{"line_number":667,"context_line":"            data[\u0027podSelector\u0027] \u003d pod_selector"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"        self.kubernetes.patch_crd(\u0027spec\u0027, url, data)"},{"line_number":670,"context_line":""},{"line_number":671,"context_line":"    def _del_knp_crd(self, netpolicy_crd):"},{"line_number":672,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_563d88db","line":669,"range":{"start_line":669,"start_character":8,"end_line":669,"end_character":52},"in_reply_to":"bf51134e_16d5d01b","updated":"2020-07-23 09:25:56.000000000","message":"by reconciliation you mean the event being retried upon the controller restart?","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"72bc0d23db10c0bccb502c611d5dea38fbb52944","unresolved":false,"context_lines":[{"line_number":666,"context_line":"        if not knp or knp[\u0027spec\u0027].get(\u0027podSelector\u0027) !\u003d pod_selector:"},{"line_number":667,"context_line":"            data[\u0027podSelector\u0027] \u003d pod_selector"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"        self.kubernetes.patch_crd(\u0027spec\u0027, url, data)"},{"line_number":670,"context_line":""},{"line_number":671,"context_line":"    def _del_knp_crd(self, netpolicy_crd):"},{"line_number":672,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_51a7520c","line":669,"range":{"start_line":669,"start_character":8,"end_line":669,"end_character":52},"in_reply_to":"bf51134e_563d88db","updated":"2020-07-23 09:34:40.000000000","message":"No, when full list of resources is fetched and injected - that was implemented in https://review.opendev.org/#/c/737843/.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"0a70c6e6809c6e49ce25ebfbd8a465a4bb43323e","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        name \u003d netpolicy[\u0027metadata\u0027][\u0027name\u0027][3:]  # Remove \u0027np-\u0027"},{"line_number":81,"context_line":"        namespace \u003d netpolicy[\u0027metadata\u0027][\u0027namespace\u0027]"},{"line_number":82,"context_line":"        link \u003d (f\u0027{constants.K8S_API_NETWORKING}/namespaces/{namespace}/\u0027"},{"line_number":83,"context_line":"               f\u0027networkpolicies/{name}\u0027)"},{"line_number":84,"context_line":"        knp \u003d {"},{"line_number":85,"context_line":"            \u0027apiVersion\u0027: \u0027openstack.org/v1\u0027,"},{"line_number":86,"context_line":"            \u0027kind\u0027: constants.K8S_OBJ_KURYRNETWORKPOLICY,"}],"source_content_type":"text/x-python","patch_set":16,"id":"9f560f44_7fc25187","line":83,"updated":"2020-07-28 20:04:37.000000000","message":"pep8: E128 continuation line under-indented for visual indent","commit_id":"d532a09d0ceba411f6dc81433f11584f7dc9fc10"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4266dddd66f910a2c3a3423519452ef32ad4e6fa","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        link \u003d (f\u0027{constants.K8S_API_NETWORKING}/namespaces/{namespace}/\u0027"},{"line_number":83,"context_line":"                f\u0027networkpolicies/{name}\u0027)"},{"line_number":84,"context_line":"        knp \u003d {"},{"line_number":85,"context_line":"            \u0027apiVersion\u0027: \u0027openstack.org/v1\u0027,"},{"line_number":86,"context_line":"            \u0027kind\u0027: constants.K8S_OBJ_KURYRNETWORKPOLICY,"},{"line_number":87,"context_line":"            \u0027metadata\u0027: {"},{"line_number":88,"context_line":"                \u0027namespace\u0027: namespace,"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_252ef0f9","line":85,"range":{"start_line":85,"start_character":26,"end_line":85,"end_character":44},"updated":"2020-07-30 10:22:46.000000000","message":"could use constants K8S_API_CRD_VERSION","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4266dddd66f910a2c3a3423519452ef32ad4e6fa","unresolved":false,"context_lines":[{"line_number":686,"context_line":"            \u0027ingressSgRules\u0027: i_rules,"},{"line_number":687,"context_line":"            \u0027egressSgRules\u0027: e_rules,"},{"line_number":688,"context_line":"        }"},{"line_number":689,"context_line":"        if not knp or knp[\u0027spec\u0027].get(\u0027podSelector\u0027) !\u003d pod_selector:"},{"line_number":690,"context_line":"            data[\u0027podSelector\u0027] \u003d pod_selector"},{"line_number":691,"context_line":""},{"line_number":692,"context_line":"        self.kubernetes.patch_crd(\u0027spec\u0027, url, data)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_c53bb4ce","line":689,"range":{"start_line":689,"start_character":11,"end_line":689,"end_character":18},"updated":"2020-07-30 10:22:46.000000000","message":"looks like this check can be removed, as in this point the knp should exist.","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5df82c009138aa6169d4ee64b916d420185dda8f","unresolved":false,"context_lines":[{"line_number":686,"context_line":"            \u0027ingressSgRules\u0027: i_rules,"},{"line_number":687,"context_line":"            \u0027egressSgRules\u0027: e_rules,"},{"line_number":688,"context_line":"        }"},{"line_number":689,"context_line":"        if not knp or knp[\u0027spec\u0027].get(\u0027podSelector\u0027) !\u003d pod_selector:"},{"line_number":690,"context_line":"            data[\u0027podSelector\u0027] \u003d pod_selector"},{"line_number":691,"context_line":""},{"line_number":692,"context_line":"        self.kubernetes.patch_crd(\u0027spec\u0027, url, data)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_0be77b42","line":689,"range":{"start_line":689,"start_character":11,"end_line":689,"end_character":18},"in_reply_to":"9f560f44_c53bb4ce","updated":"2020-07-30 12:12:25.000000000","message":"True, done.","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4266dddd66f910a2c3a3423519452ef32ad4e6fa","unresolved":false,"context_lines":[{"line_number":692,"context_line":"        self.kubernetes.patch_crd(\u0027spec\u0027, url, data)"},{"line_number":693,"context_line":""},{"line_number":694,"context_line":"    def _del_knp_crd(self, policy):"},{"line_number":695,"context_line":"        if not policy:"},{"line_number":696,"context_line":"            return False"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":"        try:"},{"line_number":699,"context_line":"            ns \u003d policy[\u0027metadata\u0027][\u0027namespace\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_a51cc013","line":696,"range":{"start_line":695,"start_character":0,"end_line":696,"end_character":24},"updated":"2020-07-30 10:22:46.000000000","message":"How is it possible that the policy here would be None?","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5df82c009138aa6169d4ee64b916d420185dda8f","unresolved":false,"context_lines":[{"line_number":692,"context_line":"        self.kubernetes.patch_crd(\u0027spec\u0027, url, data)"},{"line_number":693,"context_line":""},{"line_number":694,"context_line":"    def _del_knp_crd(self, policy):"},{"line_number":695,"context_line":"        if not policy:"},{"line_number":696,"context_line":"            return False"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":"        try:"},{"line_number":699,"context_line":"            ns \u003d policy[\u0027metadata\u0027][\u0027namespace\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_6b44371c","line":696,"range":{"start_line":695,"start_character":0,"end_line":696,"end_character":24},"in_reply_to":"9f560f44_a51cc013","updated":"2020-07-30 12:12:25.000000000","message":"Ah true.","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"}],"kuryr_kubernetes/controller/drivers/network_policy_security_groups.py":[{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"e98a2404cd9e570e272ee7c4177ab0307493447a","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    return namespaces[\u0027metadata\u0027].get(\u0027labels\u0027)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def _bump_networkpolicy(knp):"},{"line_number":48,"context_line":"    kubernetes \u003d clients.get_kubernetes_client()"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    try:"},{"line_number":51,"context_line":"        kubernetes.annotate("},{"line_number":52,"context_line":"            knp[\u0027metadata\u0027][\u0027annotations\u0027][\u0027networkPolicyLink\u0027],"},{"line_number":53,"context_line":"            {constants.K8S_ANNOTATION_POLICY: str(uuid.uuid4())})"},{"line_number":54,"context_line":"    except exceptions.K8sResourceNotFound:"},{"line_number":55,"context_line":"        LOG.exception(\"NetworkPolicy not found\")"},{"line_number":56,"context_line":"        raise"},{"line_number":57,"context_line":"    except exceptions.K8sClientException:"},{"line_number":58,"context_line":"        LOG.exception(\"Kubernetes Client Exception\")"},{"line_number":59,"context_line":"        raise"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def _create_sg_rules_with_container_ports(container_ports, matched):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_244cca40","line":59,"range":{"start_line":47,"start_character":0,"end_line":59,"end_character":13},"updated":"2020-04-28 17:20:12.000000000","message":"I get that this is bumping the CRD to create the new sg rules. However, I don\u0027t see/understand where are the new sg rules parsed here being added into the CRD.","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"0554c5fc25269f6cf20c3ff53c81b2d467edd559","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    return namespaces[\u0027metadata\u0027].get(\u0027labels\u0027)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def _bump_networkpolicy(knp):"},{"line_number":48,"context_line":"    kubernetes \u003d clients.get_kubernetes_client()"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    try:"},{"line_number":51,"context_line":"        kubernetes.annotate("},{"line_number":52,"context_line":"            knp[\u0027metadata\u0027][\u0027annotations\u0027][\u0027networkPolicyLink\u0027],"},{"line_number":53,"context_line":"            {constants.K8S_ANNOTATION_POLICY: str(uuid.uuid4())})"},{"line_number":54,"context_line":"    except exceptions.K8sResourceNotFound:"},{"line_number":55,"context_line":"        LOG.exception(\"NetworkPolicy not found\")"},{"line_number":56,"context_line":"        raise"},{"line_number":57,"context_line":"    except exceptions.K8sClientException:"},{"line_number":58,"context_line":"        LOG.exception(\"Kubernetes Client Exception\")"},{"line_number":59,"context_line":"        raise"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def _create_sg_rules_with_container_ports(container_ports, matched):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_05a98722","line":59,"range":{"start_line":47,"start_character":0,"end_line":59,"end_character":13},"in_reply_to":"1f493fa4_244cca40","updated":"2020-07-16 14:44:17.000000000","message":"We\u0027re bumping the NetworkPolicy, not the CRD. This triggers full recalculation of rules in NetworkPolicy handler and only it updates the rules on the CRD.\n\nCode here is only supposed to check if a change in rules happened. And if so force the NP update. I bet this code may be simplified later on.","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def _create_sg_rules_with_container_ports(container_ports, matched):"},{"line_number":63,"context_line":"    \"\"\"Create security group rules based on container ports"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    If it\u0027s an allow from/to everywhere rule or a rule with a"},{"line_number":66,"context_line":"    NamespaceSelector, updates a sg rule that might already exist"},{"line_number":67,"context_line":"    and match the named port or creates a new one with the"},{"line_number":68,"context_line":"    remote_ip_prefixes field containing the matched pod info."},{"line_number":69,"context_line":"    Otherwise, creates rules for each container port without"},{"line_number":70,"context_line":"    a remote_ip_prefixes field."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    param matched_pods: List of dicts where the key is a container"},{"line_number":73,"context_line":"                        port and value is the pods that have the port"},{"line_number":74,"context_line":"    param container_ports: List of tuples with pods and port values"},{"line_number":75,"context_line":"    param allow_all: True is it\u0027s an allow from/to everywhere rule,"},{"line_number":76,"context_line":"                     False otherwise."},{"line_number":77,"context_line":"    param namespace: Namespace name"},{"line_number":78,"context_line":"    param matched: If a sg rule was created for the NP rule"},{"line_number":79,"context_line":"    param crd_rules: List of sg rules to update when patching the CRD"},{"line_number":80,"context_line":"    param direction: String representing rule direction, ingress or egress"},{"line_number":81,"context_line":"    param port: Dict containing port and protocol"},{"line_number":82,"context_line":"    param rule_selected_pod: K8s Pod object selected by the rules selectors"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    return: True if a sg rule was created, False otherwise."},{"line_number":85,"context_line":"    \"\"\""},{"line_number":86,"context_line":"    for pod, container_port in container_ports:"},{"line_number":87,"context_line":"        pod_ip \u003d driver_utils.get_pod_ip(pod)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_aee97a81","line":84,"range":{"start_line":63,"start_character":0,"end_line":84,"end_character":59},"updated":"2020-04-21 08:55:14.000000000","message":"needs update","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            LOG.debug(\"Skipping SG rule creation for pod %s due to \""},{"line_number":90,"context_line":"                      \"no IP assigned\", pod[\u0027metadata\u0027][\u0027name\u0027])"},{"line_number":91,"context_line":"            continue"},{"line_number":92,"context_line":"        matched \u003d True"},{"line_number":93,"context_line":"    return matched"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_4ef4365c","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":22},"updated":"2020-04-21 08:55:14.000000000","message":"if this function is like this now, we can do a break here, or simply return True","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            LOG.debug(\"Skipping SG rule creation for pod %s due to \""},{"line_number":90,"context_line":"                      \"no IP assigned\", pod[\u0027metadata\u0027][\u0027name\u0027])"},{"line_number":91,"context_line":"            continue"},{"line_number":92,"context_line":"        matched \u003d True"},{"line_number":93,"context_line":"    return matched"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_2119f878","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":22},"in_reply_to":"1f493fa4_4ef4365c","updated":"2020-04-23 15:41:36.000000000","message":"Yup!","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"e77f1eb994d5791684c477349d933952339ca6ae","unresolved":false,"context_lines":[{"line_number":351,"context_line":""},{"line_number":352,"context_line":"    def update_sg_rules(self, pod):"},{"line_number":353,"context_line":"        LOG.debug(\"Updating SG rules for pod: %s\", pod[\u0027metadata\u0027][\u0027name\u0027])"},{"line_number":354,"context_line":"        # FIXME(dulek): No need to bump twice."},{"line_number":355,"context_line":"        crd_pod_selectors \u003d []"},{"line_number":356,"context_line":"        crd_pod_selectors.extend(self.delete_sg_rules(pod))"},{"line_number":357,"context_line":"        crd_pod_selectors.extend(self.create_sg_rules(pod))"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_246369df","line":354,"range":{"start_line":354,"start_character":7,"end_line":354,"end_character":46},"updated":"2020-07-24 11:01:00.000000000","message":"you mean to bump it here instead of in the delete/create functions?","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"3a569efd34bc752b021e9281b62a0c78141fe758","unresolved":false,"context_lines":[{"line_number":351,"context_line":""},{"line_number":352,"context_line":"    def update_sg_rules(self, pod):"},{"line_number":353,"context_line":"        LOG.debug(\"Updating SG rules for pod: %s\", pod[\u0027metadata\u0027][\u0027name\u0027])"},{"line_number":354,"context_line":"        # FIXME(dulek): No need to bump twice."},{"line_number":355,"context_line":"        crd_pod_selectors \u003d []"},{"line_number":356,"context_line":"        crd_pod_selectors.extend(self.delete_sg_rules(pod))"},{"line_number":357,"context_line":"        crd_pod_selectors.extend(self.create_sg_rules(pod))"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_1abf9cfc","line":354,"range":{"start_line":354,"start_character":7,"end_line":354,"end_character":46},"in_reply_to":"bf51134e_246369df","updated":"2020-07-24 13:24:53.000000000","message":"This simply generates the 2 events - one on delete_sg_rules and another on create_sg_rules but honestly I don\u0027t have a nice idea on how to handle this otherwise.\n\nIt\u0027s not really a very big deal though, first event should just get it right, second event will have no effect as the CRD should not get updated.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4266dddd66f910a2c3a3423519452ef32ad4e6fa","unresolved":false,"context_lines":[{"line_number":305,"context_line":"                                crd_rules, matched, crd))"},{"line_number":306,"context_line":"                    else:"},{"line_number":307,"context_line":"                        matched \u003d True"},{"line_number":308,"context_line":"                        for pod in pods:"},{"line_number":309,"context_line":"                            pod_ip \u003d driver_utils.get_pod_ip(pod)"},{"line_number":310,"context_line":"                            if not pod_ip:"},{"line_number":311,"context_line":"                                pod_name \u003d pod[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":312,"context_line":"                                LOG.debug(\"Skipping SG rule creation for pod \""},{"line_number":313,"context_line":"                                          \"%s due to no IP assigned\", pod_name)"},{"line_number":314,"context_line":"                                continue"},{"line_number":315,"context_line":"                            sg_rule \u003d _create_sg_rule("},{"line_number":316,"context_line":"                                sg_id, direction, pod_ip, port\u003dport,"},{"line_number":317,"context_line":"                                namespace\u003dns_name)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_60a8d6da","side":"PARENT","line":314,"range":{"start_line":308,"start_character":0,"end_line":314,"end_character":40},"updated":"2020-07-30 10:22:46.000000000","message":"looks like the `matched \u003d True` should have come after this iteration. Perhaps we can still leave this iteration and move the matched to after the continue?\nLike is done at line 328.","commit_id":"cecd86b2821a3d1c5aaee4697cba267c2ecc18c8"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5df82c009138aa6169d4ee64b916d420185dda8f","unresolved":false,"context_lines":[{"line_number":305,"context_line":"                                crd_rules, matched, crd))"},{"line_number":306,"context_line":"                    else:"},{"line_number":307,"context_line":"                        matched \u003d True"},{"line_number":308,"context_line":"                        for pod in pods:"},{"line_number":309,"context_line":"                            pod_ip \u003d driver_utils.get_pod_ip(pod)"},{"line_number":310,"context_line":"                            if not pod_ip:"},{"line_number":311,"context_line":"                                pod_name \u003d pod[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":312,"context_line":"                                LOG.debug(\"Skipping SG rule creation for pod \""},{"line_number":313,"context_line":"                                          \"%s due to no IP assigned\", pod_name)"},{"line_number":314,"context_line":"                                continue"},{"line_number":315,"context_line":"                            sg_rule \u003d _create_sg_rule("},{"line_number":316,"context_line":"                                sg_id, direction, pod_ip, port\u003dport,"},{"line_number":317,"context_line":"                                namespace\u003dns_name)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_ebee87b2","side":"PARENT","line":314,"range":{"start_line":308,"start_character":0,"end_line":314,"end_character":40},"in_reply_to":"9f560f44_60a8d6da","updated":"2020-07-30 12:12:25.000000000","message":"You\u0027ve found a bug? ;)","commit_id":"cecd86b2821a3d1c5aaee4697cba267c2ecc18c8"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4266dddd66f910a2c3a3423519452ef32ad4e6fa","unresolved":false,"context_lines":[{"line_number":250,"context_line":"    for rule in rule_list:"},{"line_number":251,"context_line":"        LOG.debug(\u0027Parsing %(dir)s Rule %(r)s\u0027, {\u0027dir\u0027: direction, \u0027r\u0027: rule})"},{"line_number":252,"context_line":"        remote_ip_prefix \u003d rule[\u0027sgRule\u0027].get(\u0027remote_ip_prefix\u0027)"},{"line_number":253,"context_line":"        affectedPods \u003d rule.get(\u0027affectedPods\u0027, {})"},{"line_number":254,"context_line":"        if remote_ip_prefix and remote_ip_prefix \u003d\u003d pod_ip:"},{"line_number":255,"context_line":"            return True"},{"line_number":256,"context_line":"        elif affectedPods:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_e529989b","line":253,"range":{"start_line":253,"start_character":48,"end_line":253,"end_character":50},"updated":"2020-07-30 10:22:46.000000000","message":"affectedPods is of type list now, so the default value should also be a list","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5df82c009138aa6169d4ee64b916d420185dda8f","unresolved":false,"context_lines":[{"line_number":250,"context_line":"    for rule in rule_list:"},{"line_number":251,"context_line":"        LOG.debug(\u0027Parsing %(dir)s Rule %(r)s\u0027, {\u0027dir\u0027: direction, \u0027r\u0027: rule})"},{"line_number":252,"context_line":"        remote_ip_prefix \u003d rule[\u0027sgRule\u0027].get(\u0027remote_ip_prefix\u0027)"},{"line_number":253,"context_line":"        affectedPods \u003d rule.get(\u0027affectedPods\u0027, {})"},{"line_number":254,"context_line":"        if remote_ip_prefix and remote_ip_prefix \u003d\u003d pod_ip:"},{"line_number":255,"context_line":"            return True"},{"line_number":256,"context_line":"        elif affectedPods:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_cbf8e3c5","line":253,"range":{"start_line":253,"start_character":48,"end_line":253,"end_character":50},"in_reply_to":"9f560f44_e529989b","updated":"2020-07-30 12:12:25.000000000","message":"True!","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4266dddd66f910a2c3a3423519452ef32ad4e6fa","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        LOG.debug(\u0027Parsing %(dir)s Rule %(r)s\u0027, {\u0027dir\u0027: direction, \u0027r\u0027: rule})"},{"line_number":252,"context_line":"        remote_ip_prefix \u003d rule[\u0027sgRule\u0027].get(\u0027remote_ip_prefix\u0027)"},{"line_number":253,"context_line":"        affectedPods \u003d rule.get(\u0027affectedPods\u0027, {})"},{"line_number":254,"context_line":"        if remote_ip_prefix and remote_ip_prefix \u003d\u003d pod_ip:"},{"line_number":255,"context_line":"            return True"},{"line_number":256,"context_line":"        elif affectedPods:"},{"line_number":257,"context_line":"            for pod_info in affectedPods:"},{"line_number":258,"context_line":"                if pod_info[\u0027podIP\u0027] \u003d\u003d pod_ip:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_8546dc7b","line":255,"range":{"start_line":254,"start_character":0,"end_line":255,"end_character":23},"updated":"2020-07-30 10:22:46.000000000","message":"Why is this still needed? upon upgrade won\u0027t this field get removed in favor of affectedPods?","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5df82c009138aa6169d4ee64b916d420185dda8f","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        LOG.debug(\u0027Parsing %(dir)s Rule %(r)s\u0027, {\u0027dir\u0027: direction, \u0027r\u0027: rule})"},{"line_number":252,"context_line":"        remote_ip_prefix \u003d rule[\u0027sgRule\u0027].get(\u0027remote_ip_prefix\u0027)"},{"line_number":253,"context_line":"        affectedPods \u003d rule.get(\u0027affectedPods\u0027, {})"},{"line_number":254,"context_line":"        if remote_ip_prefix and remote_ip_prefix \u003d\u003d pod_ip:"},{"line_number":255,"context_line":"            return True"},{"line_number":256,"context_line":"        elif affectedPods:"},{"line_number":257,"context_line":"            for pod_info in affectedPods:"},{"line_number":258,"context_line":"                if pod_info[\u0027podIP\u0027] \u003d\u003d pod_ip:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_6b12770b","line":255,"range":{"start_line":254,"start_character":0,"end_line":255,"end_character":23},"in_reply_to":"9f560f44_8546dc7b","updated":"2020-07-30 12:12:25.000000000","message":"That\u0027s remote_ip_prefix, not remote_ip_prefixes.","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4266dddd66f910a2c3a3423519452ef32ad4e6fa","unresolved":false,"context_lines":[{"line_number":380,"context_line":"        crd_selectors \u003d []"},{"line_number":381,"context_line":"        knp_crds \u003d driver_utils.get_kuryrnetworkpolicy_crds()"},{"line_number":382,"context_line":"        nps \u003d driver_utils.get_networkpolicies()"},{"line_number":383,"context_line":"        pairs \u003d driver_utils.zip_knp_np(knp_crds, nps)"},{"line_number":384,"context_line":"        for crd, policy in pairs:"},{"line_number":385,"context_line":"            crd_selector \u003d crd[\u0027spec\u0027].get(\u0027podSelector\u0027)"},{"line_number":386,"context_line":"            spec \u003d policy.get(\u0027spec\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_20ec1e28","line":383,"range":{"start_line":383,"start_character":29,"end_line":383,"end_character":39},"updated":"2020-07-30 10:22:46.000000000","message":"Nice!","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"}],"kuryr_kubernetes/controller/drivers/utils.py":[{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4067ac68d8b415afd0d0728e25de99e2f76104e2","unresolved":false,"context_lines":[{"line_number":241,"context_line":"    if not protocol:"},{"line_number":242,"context_line":"        protocol \u003d \u0027TCP\u0027"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    if not ethertype:"},{"line_number":245,"context_line":"        ethertype \u003d \u0027IPv4\u0027"},{"line_number":246,"context_line":"        if cidr and netaddr.IPNetwork(cidr).version \u003d\u003d 6:"},{"line_number":247,"context_line":"            ethertype \u003d \u0027IPv6\u0027"},{"line_number":248,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_4dc86420","line":245,"range":{"start_line":244,"start_character":1,"end_line":245,"end_character":26},"updated":"2020-07-22 22:19:25.000000000","message":"looks like this can get removed.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"e77f1eb994d5791684c477349d933952339ca6ae","unresolved":false,"context_lines":[{"line_number":396,"context_line":""},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"def match_selector(selector, labels):"},{"line_number":399,"context_line":"    if selector is None:"},{"line_number":400,"context_line":"        return True"},{"line_number":401,"context_line":"    crd_labels \u003d selector.get(\u0027matchLabels\u0027, None)"},{"line_number":402,"context_line":"    crd_expressions \u003d selector.get(\u0027matchExpressions\u0027, None)"},{"line_number":403,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_49f8387b","line":400,"range":{"start_line":399,"start_character":0,"end_line":400,"end_character":19},"updated":"2020-07-24 11:01:00.000000000","message":"umm, is that the case?","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"9cd3f3dac9c258f156dab3af3f02d576308c7bc9","unresolved":false,"context_lines":[{"line_number":396,"context_line":""},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"def match_selector(selector, labels):"},{"line_number":399,"context_line":"    if selector is None:"},{"line_number":400,"context_line":"        return True"},{"line_number":401,"context_line":"    crd_labels \u003d selector.get(\u0027matchLabels\u0027, None)"},{"line_number":402,"context_line":"    crd_expressions \u003d selector.get(\u0027matchExpressions\u0027, None)"},{"line_number":403,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_28e69b17","line":400,"range":{"start_line":399,"start_character":0,"end_line":400,"end_character":19},"in_reply_to":"bf51134e_49f8387b","updated":"2020-07-24 14:17:03.000000000","message":"Uhm, IIRC I made it a special case, selector always needs to be specified, but podSelector on KNP status may be not.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"}],"kuryr_kubernetes/controller/handlers/kuryrnetwork.py":[{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    def _is_network_policy_enabled(self):"},{"line_number":132,"context_line":"        enabled_handlers \u003d oslo_cfg.CONF.kubernetes.enabled_handlers"},{"line_number":133,"context_line":"        svc_sg_driver \u003d oslo_cfg.CONF.kubernetes.service_security_groups_driver"},{"line_number":134,"context_line":"        return \u0027policy\u0027 in enabled_handlers and svc_sg_driver \u003d\u003d \u0027policy\u0027"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def _update_services(self, services, crd_selectors, project_id):"},{"line_number":137,"context_line":"        for service in services.get(\u0027items\u0027):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_2eb8ca28","line":134,"range":{"start_line":134,"start_character":15,"end_line":134,"end_character":73},"updated":"2020-04-21 08:55:14.000000000","message":"you didn\u0027t like the ()? xD","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    def _is_network_policy_enabled(self):"},{"line_number":132,"context_line":"        enabled_handlers \u003d oslo_cfg.CONF.kubernetes.enabled_handlers"},{"line_number":133,"context_line":"        svc_sg_driver \u003d oslo_cfg.CONF.kubernetes.service_security_groups_driver"},{"line_number":134,"context_line":"        return \u0027policy\u0027 in enabled_handlers and svc_sg_driver \u003d\u003d \u0027policy\u0027"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def _update_services(self, services, crd_selectors, project_id):"},{"line_number":137,"context_line":"        for service in services.get(\u0027items\u0027):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_a126a8b6","line":134,"range":{"start_line":134,"start_character":15,"end_line":134,"end_character":73},"in_reply_to":"1f493fa4_2eb8ca28","updated":"2020-04-23 15:41:36.000000000","message":"My IDE said it\u0027s unneccesary, but you\u0027re right, if I\u0027m not touching this file, I\u0027d better remove this change. ;)","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"}],"kuryr_kubernetes/controller/handlers/kuryrnetworkpolicy.py":[{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":31,"context_line":"class KuryrNetworkPolicyHandler(k8s_base.ResourceEventHandler):"},{"line_number":32,"context_line":"    \"\"\"Controller side of KuryrNetPolicy process for Kubernetes pods."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    `KuryrNetPolicyHandler` runs on the Kuryr-Kubernetes controller and is"},{"line_number":35,"context_line":"    responsible for deleting associated security groups upon namespace"},{"line_number":36,"context_line":"    deletion."},{"line_number":37,"context_line":"    \"\"\""},{"line_number":38,"context_line":"    OBJECT_KIND \u003d constants.K8S_OBJ_KURYRNETWORKPOLICY"},{"line_number":39,"context_line":"    OBJECT_WATCH_PATH \u003d constants.K8S_API_CRD_KURYRNETWORKPOLICIES"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_6e893225","line":36,"range":{"start_line":34,"start_character":0,"end_line":36,"end_character":13},"updated":"2020-04-21 08:55:14.000000000","message":"I think this needs update","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":31,"context_line":"class KuryrNetworkPolicyHandler(k8s_base.ResourceEventHandler):"},{"line_number":32,"context_line":"    \"\"\"Controller side of KuryrNetPolicy process for Kubernetes pods."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    `KuryrNetPolicyHandler` runs on the Kuryr-Kubernetes controller and is"},{"line_number":35,"context_line":"    responsible for deleting associated security groups upon namespace"},{"line_number":36,"context_line":"    deletion."},{"line_number":37,"context_line":"    \"\"\""},{"line_number":38,"context_line":"    OBJECT_KIND \u003d constants.K8S_OBJ_KURYRNETWORKPOLICY"},{"line_number":39,"context_line":"    OBJECT_WATCH_PATH \u003d constants.K8S_API_CRD_KURYRNETWORKPOLICIES"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_8b98b01b","line":36,"range":{"start_line":34,"start_character":0,"end_line":36,"end_character":13},"in_reply_to":"1f493fa4_6e893225","updated":"2020-04-23 15:41:36.000000000","message":"Done","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def _get_networkpolicy(self, link):"},{"line_number":91,"context_line":"        return self.k8s.get(link)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def _compare_sgs(self, a, b):"},{"line_number":94,"context_line":"        checked_props \u003d (\u0027direction\u0027, \u0027ethertype\u0027, \u0027port_range_max\u0027,"},{"line_number":95,"context_line":"                         \u0027port_range_min\u0027, \u0027protocol\u0027, \u0027remote_ip_prefix\u0027)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        for k in checked_props:"},{"line_number":98,"context_line":"            if a.get(k) !\u003d b.get(k):"},{"line_number":99,"context_line":"                return False"},{"line_number":100,"context_line":"        return True"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _find_sgs(self, a, rules):"},{"line_number":103,"context_line":"        for r in rules:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_8e88fe1f","line":100,"range":{"start_line":93,"start_character":0,"end_line":100,"end_character":19},"updated":"2020-04-21 08:55:14.000000000","message":"sweet!","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        return False"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _convert_old_crds(self):"},{"line_number":110,"context_line":"        pass"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def on_present(self, knp):"},{"line_number":113,"context_line":"        uniq_name \u003d utils.get_unique_name(knp)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_0e74ee34","line":110,"range":{"start_line":109,"start_character":0,"end_line":110,"end_character":12},"updated":"2020-04-21 08:55:14.000000000","message":"remove it?","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        return False"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _convert_old_crds(self):"},{"line_number":110,"context_line":"        pass"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def on_present(self, knp):"},{"line_number":113,"context_line":"        uniq_name \u003d utils.get_unique_name(knp)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_6b772404","line":110,"range":{"start_line":109,"start_character":0,"end_line":110,"end_character":12},"in_reply_to":"1f493fa4_0e74ee34","updated":"2020-04-23 15:41:36.000000000","message":"Done","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            LOG.debug(\u0027Created SG %s for NP %s\u0027, sg_id, uniq_name)"},{"line_number":125,"context_line":"        else:"},{"line_number":126,"context_line":"            # TODO(dulek): Check if it really exists, recreate if not."},{"line_number":127,"context_line":"            sg_id \u003d knp[\u0027status\u0027].get(\u0027securityGroupId\u0027)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        # First update SG rules as we want to apply updated ones"},{"line_number":130,"context_line":"        current \u003d knp[\u0027status\u0027][\u0027securityGroupRules\u0027]"},{"line_number":131,"context_line":"        required \u003d knp[\u0027spec\u0027][\u0027ingressSgRules\u0027] + knp[\u0027spec\u0027][\u0027egressSgRules\u0027]"},{"line_number":132,"context_line":"        required \u003d [r[\u0027security_group_rule\u0027] for r in required]"},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_8eebdeae","line":130,"range":{"start_line":127,"start_character":0,"end_line":130,"end_character":53},"updated":"2020-04-21 08:55:14.000000000","message":"perhaps we can do a get of the SG, so that we ensure the SG id exists, but also we get the real current sg rules. This should avoid the problem/race stated at lines 134-143, right?","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            LOG.debug(\u0027Created SG %s for NP %s\u0027, sg_id, uniq_name)"},{"line_number":125,"context_line":"        else:"},{"line_number":126,"context_line":"            # TODO(dulek): Check if it really exists, recreate if not."},{"line_number":127,"context_line":"            sg_id \u003d knp[\u0027status\u0027].get(\u0027securityGroupId\u0027)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        # First update SG rules as we want to apply updated ones"},{"line_number":130,"context_line":"        current \u003d knp[\u0027status\u0027][\u0027securityGroupRules\u0027]"},{"line_number":131,"context_line":"        required \u003d knp[\u0027spec\u0027][\u0027ingressSgRules\u0027] + knp[\u0027spec\u0027][\u0027egressSgRules\u0027]"},{"line_number":132,"context_line":"        required \u003d [r[\u0027security_group_rule\u0027] for r in required]"},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_ebb85477","line":130,"range":{"start_line":127,"start_character":0,"end_line":130,"end_character":53},"in_reply_to":"1f493fa4_8eebdeae","updated":"2020-04-23 15:41:36.000000000","message":"Yup!","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":161,"context_line":"            knp \u003d self._patch_kuryrnetworkpolicy_crd("},{"line_number":162,"context_line":"                knp, \u0027status\u0027, {\u0027securityGroupRules/-\u0027: sg_rule}, \u0027add\u0027)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        # We need to remove starting from the last one in order to maintain"},{"line_number":165,"context_line":"        # indexes. Please note this will start to fail miserably if we start"},{"line_number":166,"context_line":"        # to change status from multiple places."},{"line_number":167,"context_line":"        to_remove.reverse()"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        LOG.debug(\u0027SGs to remove for NP %s: %s\u0027, uniq_name,"},{"line_number":170,"context_line":"                  [x[1] for x in to_remove])"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        for i, sg_rule_id in to_remove:"},{"line_number":173,"context_line":"            LOG.debug(\u0027Removing SG rule %s as it is no longer part of NP %s\u0027,"},{"line_number":174,"context_line":"                      sg_rule_id, uniq_name)"},{"line_number":175,"context_line":"            driver_utils.delete_security_group_rule(sg_rule_id)"},{"line_number":176,"context_line":"            knp \u003d self._patch_kuryrnetworkpolicy_crd("},{"line_number":177,"context_line":"                knp, \u0027status/securityGroupRules\u0027, i, \u0027remove\u0027)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        pods_to_update \u003d []"},{"line_number":180,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_0ef06e90","line":177,"range":{"start_line":164,"start_character":0,"end_line":177,"end_character":62},"updated":"2020-04-21 08:55:14.000000000","message":"wouldn\u0027t it be better to not rely on this, remove SGs one by one and only update the status at the end? \nGiven that removing SGs could be an expensive operation, if by any chance the removal fails and in between a NP happens, it may be that there is extra additions to the status breaking the ordering here","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":161,"context_line":"            knp \u003d self._patch_kuryrnetworkpolicy_crd("},{"line_number":162,"context_line":"                knp, \u0027status\u0027, {\u0027securityGroupRules/-\u0027: sg_rule}, \u0027add\u0027)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        # We need to remove starting from the last one in order to maintain"},{"line_number":165,"context_line":"        # indexes. Please note this will start to fail miserably if we start"},{"line_number":166,"context_line":"        # to change status from multiple places."},{"line_number":167,"context_line":"        to_remove.reverse()"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        LOG.debug(\u0027SGs to remove for NP %s: %s\u0027, uniq_name,"},{"line_number":170,"context_line":"                  [x[1] for x in to_remove])"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        for i, sg_rule_id in to_remove:"},{"line_number":173,"context_line":"            LOG.debug(\u0027Removing SG rule %s as it is no longer part of NP %s\u0027,"},{"line_number":174,"context_line":"                      sg_rule_id, uniq_name)"},{"line_number":175,"context_line":"            driver_utils.delete_security_group_rule(sg_rule_id)"},{"line_number":176,"context_line":"            knp \u003d self._patch_kuryrnetworkpolicy_crd("},{"line_number":177,"context_line":"                knp, \u0027status/securityGroupRules\u0027, i, \u0027remove\u0027)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        pods_to_update \u003d []"},{"line_number":180,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_e6224ba4","line":177,"range":{"start_line":164,"start_character":0,"end_line":177,"end_character":62},"in_reply_to":"1f493fa4_0ef06e90","updated":"2020-04-23 15:41:36.000000000","message":"Nah, it should be quite safe here, because this is the only place in the code where we add or remove SGs. And as this handler is inheriting from AsyncHandler, we can be sure that requests to a single resource are queued nicely, so we always process them one-by-one.","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            for service in services.get(\u0027items\u0027, []):"},{"line_number":208,"context_line":"                # TODO(ltomasbo): Skip other services that are not affected"},{"line_number":209,"context_line":"                # by the policy"},{"line_number":210,"context_line":"                if (not service[\u0027spec\u0027].get(\u0027selector\u0027) or not"},{"line_number":211,"context_line":"                        self._is_service_affected(service, pods_to_update)):"},{"line_number":212,"context_line":"                    continue"},{"line_number":213,"context_line":"                sgs \u003d self._drv_svc_sg.get_security_groups(service, project_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_ae0dfa91","line":210,"range":{"start_line":210,"start_character":20,"end_line":210,"end_character":55},"updated":"2020-04-21 08:55:14.000000000","message":"perhaps this needs to be reconsidered now? Or add a FIXME here about the selector once this is supported, otherwise we will forget about the NP implications of that","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            for service in services.get(\u0027items\u0027, []):"},{"line_number":208,"context_line":"                # TODO(ltomasbo): Skip other services that are not affected"},{"line_number":209,"context_line":"                # by the policy"},{"line_number":210,"context_line":"                if (not service[\u0027spec\u0027].get(\u0027selector\u0027) or not"},{"line_number":211,"context_line":"                        self._is_service_affected(service, pods_to_update)):"},{"line_number":212,"context_line":"                    continue"},{"line_number":213,"context_line":"                sgs \u003d self._drv_svc_sg.get_security_groups(service, project_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_eb6df404","line":210,"range":{"start_line":210,"start_character":20,"end_line":210,"end_character":55},"in_reply_to":"1f493fa4_ae0dfa91","updated":"2020-04-23 15:41:36.000000000","message":"Done","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def _is_service_affected(self, service, affected_pods):"},{"line_number":220,"context_line":"        svc_namespace \u003d service[\u0027metadata\u0027][\u0027namespace\u0027]"},{"line_number":221,"context_line":"        svc_selector \u003d service[\u0027spec\u0027].get(\u0027selector\u0027)"},{"line_number":222,"context_line":"        svc_pods \u003d driver_utils.get_pods({\u0027selector\u0027: svc_selector},"},{"line_number":223,"context_line":"                                         svc_namespace).get(\u0027items\u0027)"},{"line_number":224,"context_line":"        return any(pod in svc_pods for pod in affected_pods)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_ee26e216","line":221,"range":{"start_line":221,"start_character":8,"end_line":221,"end_character":54},"updated":"2020-04-21 08:55:14.000000000","message":"perhaps we need to check if service has endpoints... but that is for a follow up","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"e98a2404cd9e570e272ee7c4177ab0307493447a","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        except (ValueError, KeyError):"},{"line_number":306,"context_line":"            pass"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        self.k8s.patch_crd("},{"line_number":309,"context_line":"            \u0027metadata\u0027, knp[\u0027metadata\u0027][\u0027selfLink\u0027], {\u0027finalizers\u0027: []},"},{"line_number":310,"context_line":"            action\u003d\u0027replace\u0027)"},{"line_number":311,"context_line":"        if i is not None:"},{"line_number":312,"context_line":"            self.k8s.patch_crd("},{"line_number":313,"context_line":"                \u0027metadata/finalizers\u0027, policy[\u0027metadata\u0027][\u0027selfLink\u0027], i,"},{"line_number":314,"context_line":"                action\u003d\u0027remove\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_c1ad189c","line":314,"range":{"start_line":308,"start_character":0,"end_line":314,"end_character":32},"updated":"2020-04-28 17:20:12.000000000","message":"Perhaps we could just remove the finalizer from the list and replace the result into the CRD. According to the doc when the list is empty the resource is allowed to be removed. [1]\n\n[1] https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#advanced-topics","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"e77f1eb994d5791684c477349d933952339ca6ae","unresolved":false,"context_lines":[{"line_number":253,"context_line":"            policy \u003d self._get_networkpolicy(knp[\u0027metadata\u0027][\u0027annotations\u0027]"},{"line_number":254,"context_line":"                                             [\u0027networkPolicyLink\u0027])"},{"line_number":255,"context_line":"        except exceptions.K8sResourceNotFound:"},{"line_number":256,"context_line":"            # NP is already gone, let\u0027s just try to clean up."},{"line_number":257,"context_line":"            policy \u003d None"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        if crd_sg:"},{"line_number":260,"context_line":"            for pod in pods_to_update:"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_042105a0","line":257,"range":{"start_line":256,"start_character":0,"end_line":257,"end_character":25},"updated":"2020-07-24 11:01:00.000000000","message":"this should not be possible, right?\n\nOhh, I see, this could be possible if kuryr-controller restarts at line 306.\n\nPerhaps this can be avoided by handling the removal of finalizers in the way that Roman did it for Kuryr ports here: https://review.opendev.org/#/c/733168/16/kuryr_kubernetes/controller/handlers/vif.py","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"3a569efd34bc752b021e9281b62a0c78141fe758","unresolved":false,"context_lines":[{"line_number":253,"context_line":"            policy \u003d self._get_networkpolicy(knp[\u0027metadata\u0027][\u0027annotations\u0027]"},{"line_number":254,"context_line":"                                             [\u0027networkPolicyLink\u0027])"},{"line_number":255,"context_line":"        except exceptions.K8sResourceNotFound:"},{"line_number":256,"context_line":"            # NP is already gone, let\u0027s just try to clean up."},{"line_number":257,"context_line":"            policy \u003d None"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        if crd_sg:"},{"line_number":260,"context_line":"            for pod in pods_to_update:"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_ba35d0aa","line":257,"range":{"start_line":256,"start_character":0,"end_line":257,"end_character":25},"in_reply_to":"bf51134e_042105a0","updated":"2020-07-24 13:24:53.000000000","message":"Still better to handle it just in case someone forced the NP to get deleted. I\u0027ll think about Roman\u0027s approach. The good thing this can be fixed as a next step easily.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4266dddd66f910a2c3a3423519452ef32ad4e6fa","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                    sgs \u003d self._drv_svc_sg.get_security_groups(svc, project_id)"},{"line_number":298,"context_line":"                    self._drv_lbaas.update_lbaas_sg(svc, sgs)"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"        sg_id \u003d knp[\u0027status\u0027].get(\u0027securityGroupId\u0027)"},{"line_number":301,"context_line":"        if sg_id:"},{"line_number":302,"context_line":"            self._drv_policy.delete_np_sg(sg_id)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"        LOG.debug(\"Removing finalizers from KuryrNetworkPolicy and \""},{"line_number":305,"context_line":"                  \"NetworkPolicy.\")"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_05adac87","line":302,"range":{"start_line":300,"start_character":0,"end_line":302,"end_character":48},"updated":"2020-07-30 10:22:46.000000000","message":"The same is done at line 261. Perhaps the deletion of the sg can be intended and the check removed?","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5df82c009138aa6169d4ee64b916d420185dda8f","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                    sgs \u003d self._drv_svc_sg.get_security_groups(svc, project_id)"},{"line_number":298,"context_line":"                    self._drv_lbaas.update_lbaas_sg(svc, sgs)"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"        sg_id \u003d knp[\u0027status\u0027].get(\u0027securityGroupId\u0027)"},{"line_number":301,"context_line":"        if sg_id:"},{"line_number":302,"context_line":"            self._drv_policy.delete_np_sg(sg_id)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"        LOG.debug(\"Removing finalizers from KuryrNetworkPolicy and \""},{"line_number":305,"context_line":"                  \"NetworkPolicy.\")"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_4b6053a6","line":302,"range":{"start_line":300,"start_character":0,"end_line":302,"end_character":48},"in_reply_to":"9f560f44_05adac87","updated":"2020-07-30 12:12:25.000000000","message":"Yeah, true.","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"}],"kuryr_kubernetes/controller/handlers/pod_label.py":[{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"e98a2404cd9e570e272ee7c4177ab0307493447a","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            return"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        current_pod_info \u003d (pod[\u0027metadata\u0027].get(\u0027labels\u0027),"},{"line_number":55,"context_line":"                            pod[\u0027status\u0027].get(\u0027podIP\u0027))"},{"line_number":56,"context_line":"        previous_pod_info \u003d self._get_pod_info(pod)"},{"line_number":57,"context_line":"        LOG.debug(\"Got previous pod info from annotation: %r\","},{"line_number":58,"context_line":"                  previous_pod_info)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_a1f1ec6d","line":55,"range":{"start_line":55,"start_character":28,"end_line":55,"end_character":54},"updated":"2020-04-28 17:20:12.000000000","message":"why is the podIP also annotated?","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"0554c5fc25269f6cf20c3ff53c81b2d467edd559","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            return"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        current_pod_info \u003d (pod[\u0027metadata\u0027].get(\u0027labels\u0027),"},{"line_number":55,"context_line":"                            pod[\u0027status\u0027].get(\u0027podIP\u0027))"},{"line_number":56,"context_line":"        previous_pod_info \u003d self._get_pod_info(pod)"},{"line_number":57,"context_line":"        LOG.debug(\"Got previous pod info from annotation: %r\","},{"line_number":58,"context_line":"                  previous_pod_info)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_484ef66e","line":55,"range":{"start_line":55,"start_character":28,"end_line":55,"end_character":54},"in_reply_to":"1f493fa4_a1f1ec6d","updated":"2020-07-16 14:44:17.000000000","message":"To be able to associate correct SGs to pod and LB once it gets an IP. At least I think, honestly at this point I don\u0027t exactly remember.","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"4067ac68d8b415afd0d0728e25de99e2f76104e2","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        if current_pod_info \u003d\u003d previous_pod_info:"},{"line_number":61,"context_line":"            return"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        # FIXME(dulek): We should be able to just do create if only podIP"},{"line_number":64,"context_line":"        #               changed, right?"},{"line_number":65,"context_line":"        crd_pod_selectors \u003d self._drv_sg.update_sg_rules(pod)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        project_id \u003d self._drv_project.get_project(pod)"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_8db9dc7a","line":64,"range":{"start_line":63,"start_character":0,"end_line":64,"end_character":39},"updated":"2020-07-22 22:19:25.000000000","message":"In which scenario the podIP changes? or you mean moving from no ip to having ip?","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"e8374b1dc62c85aa849c63a686483e9d89fc4630","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        if current_pod_info \u003d\u003d previous_pod_info:"},{"line_number":61,"context_line":"            return"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        # FIXME(dulek): We should be able to just do create if only podIP"},{"line_number":64,"context_line":"        #               changed, right?"},{"line_number":65,"context_line":"        crd_pod_selectors \u003d self._drv_sg.update_sg_rules(pod)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        project_id \u003d self._drv_project.get_project(pod)"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_f11b0670","line":64,"range":{"start_line":63,"start_character":0,"end_line":64,"end_character":39},"in_reply_to":"bf51134e_362a94e6","updated":"2020-07-23 09:25:56.000000000","message":"isn\u0027t this event being ignored if the pod has no ip at line 50? perhaps this fixme can be removed.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"91a08fc43640e528b834163d08825a7f49f10871","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        if current_pod_info \u003d\u003d previous_pod_info:"},{"line_number":61,"context_line":"            return"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        # FIXME(dulek): We should be able to just do create if only podIP"},{"line_number":64,"context_line":"        #               changed, right?"},{"line_number":65,"context_line":"        crd_pod_selectors \u003d self._drv_sg.update_sg_rules(pod)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        project_id \u003d self._drv_project.get_project(pod)"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_362a94e6","line":64,"range":{"start_line":63,"start_character":0,"end_line":64,"end_character":39},"in_reply_to":"bf51134e_8db9dc7a","updated":"2020-07-23 09:06:17.000000000","message":"Ah yes, this is here because when created pods have no IP, so we can\u0027t update the SGs based on that yet. Same happens when pod \"loses\" IP after it\u0027s completed.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"72bc0d23db10c0bccb502c611d5dea38fbb52944","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        if current_pod_info \u003d\u003d previous_pod_info:"},{"line_number":61,"context_line":"            return"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        # FIXME(dulek): We should be able to just do create if only podIP"},{"line_number":64,"context_line":"        #               changed, right?"},{"line_number":65,"context_line":"        crd_pod_selectors \u003d self._drv_sg.update_sg_rules(pod)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        project_id \u003d self._drv_project.get_project(pod)"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_d1b24249","line":64,"range":{"start_line":63,"start_character":0,"end_line":64,"end_character":39},"in_reply_to":"bf51134e_f11b0670","updated":"2020-07-23 09:34:40.000000000","message":"Nah, this is related to the fact that if just podIP is changed we should be able to run self._drv_sg.create_sg_rules(pod) instead of full update.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"e77f1eb994d5791684c477349d933952339ca6ae","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        k8s.annotate(pod[\u0027metadata\u0027][\u0027selfLink\u0027],"},{"line_number":100,"context_line":"                     {"},{"line_number":101,"context_line":"                         constants.K8S_ANNOTATION_LABEL: annotation[0],"},{"line_number":102,"context_line":"                         constants.K8S_ANNOTATION_IP: annotation[1]"},{"line_number":103,"context_line":"                     },"},{"line_number":104,"context_line":"                     resource_version\u003dpod[\u0027metadata\u0027][\u0027resourceVersion\u0027])"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_c91288b4","line":102,"range":{"start_line":102,"start_character":0,"end_line":102,"end_character":67},"updated":"2020-07-24 11:01:00.000000000","message":"umm, not sure about this pod ip thing, specially as pods are not changing IPs, right? and Roman is implementing the pod CRD, perhaps we can simply check if there is a KuryrPort CR for the pod?","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"3a569efd34bc752b021e9281b62a0c78141fe758","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        k8s.annotate(pod[\u0027metadata\u0027][\u0027selfLink\u0027],"},{"line_number":100,"context_line":"                     {"},{"line_number":101,"context_line":"                         constants.K8S_ANNOTATION_LABEL: annotation[0],"},{"line_number":102,"context_line":"                         constants.K8S_ANNOTATION_IP: annotation[1]"},{"line_number":103,"context_line":"                     },"},{"line_number":104,"context_line":"                     resource_version\u003dpod[\u0027metadata\u0027][\u0027resourceVersion\u0027])"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_babaf0dd","line":102,"range":{"start_line":102,"start_character":0,"end_line":102,"end_character":67},"in_reply_to":"bf51134e_c91288b4","updated":"2020-07-24 13:24:53.000000000","message":"The point of that part was to be able to respond to the exact event when pod got the IP assigned. With KuryrPort CRD it\u0027s not really much different - this is built around K8s writing down IP of the Pod into Pod object, not Kuryr deciding which IP it\u0027ll get.\n\nMaybe it might be optimized to use KuryrPort, I\u0027m pretty sure, but this way should still work just fine. And as it\u0027s a separate annotation any upgrade issues shouldn\u0027t concern us if we\u0027re to do such optimization in the future.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"734bc3cad166449eb78784009a0b34d8815d0fab","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            return"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        current_pod_info \u003d (pod[\u0027metadata\u0027].get(\u0027labels\u0027),"},{"line_number":62,"context_line":"                            pod[\u0027status\u0027].get(\u0027podIP\u0027))"},{"line_number":63,"context_line":"        previous_pod_info \u003d self._get_pod_info(pod)"},{"line_number":64,"context_line":"        LOG.debug(\"Got previous pod info from annotation: %r\","},{"line_number":65,"context_line":"                  previous_pod_info)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_800feadf","line":62,"range":{"start_line":62,"start_character":28,"end_line":62,"end_character":54},"updated":"2020-07-30 10:33:03.000000000","message":"why the pod IP is included here?","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"b274c1b971b7ac70ece76a2e298a22c6c7e8fdf6","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            return"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        current_pod_info \u003d (pod[\u0027metadata\u0027].get(\u0027labels\u0027),"},{"line_number":62,"context_line":"                            pod[\u0027status\u0027].get(\u0027podIP\u0027))"},{"line_number":63,"context_line":"        previous_pod_info \u003d self._get_pod_info(pod)"},{"line_number":64,"context_line":"        LOG.debug(\"Got previous pod info from annotation: %r\","},{"line_number":65,"context_line":"                  previous_pod_info)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_cb03c341","line":62,"range":{"start_line":62,"start_character":28,"end_line":62,"end_character":54},"in_reply_to":"9f560f44_2bca3f19","updated":"2020-07-30 12:16:59.000000000","message":"perhaps it was not needed because at line 50 we checked if pod has a state.","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5df82c009138aa6169d4ee64b916d420185dda8f","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            return"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        current_pod_info \u003d (pod[\u0027metadata\u0027].get(\u0027labels\u0027),"},{"line_number":62,"context_line":"                            pod[\u0027status\u0027].get(\u0027podIP\u0027))"},{"line_number":63,"context_line":"        previous_pod_info \u003d self._get_pod_info(pod)"},{"line_number":64,"context_line":"        LOG.debug(\"Got previous pod info from annotation: %r\","},{"line_number":65,"context_line":"                  previous_pod_info)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9f560f44_2bca3f19","line":62,"range":{"start_line":62,"start_character":28,"end_line":62,"end_character":54},"in_reply_to":"9f560f44_800feadf","updated":"2020-07-30 12:12:25.000000000","message":"It\u0027s to make sure we catch the moment when pod is running and has podIP and then we\u0027ll trigger update_sg_rules. I\u0027m not exactly sure why this wasn\u0027t needed previously, but for some reason it wasn\u0027t. :P","commit_id":"806aa8f043f5d8e4e7e6474cbf7f91484848054b"}],"kuryr_kubernetes/controller/handlers/policy.py":[{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"e98a2404cd9e570e272ee7c4177ab0307493447a","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    def on_present(self, policy):"},{"line_number":45,"context_line":"        LOG.debug(\"Created or updated: %s\", policy)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        # Put finalizer in"},{"line_number":48,"context_line":"        if (k_const.NETWORKPOLICY_FINALIZER not in"},{"line_number":49,"context_line":"                policy[\u0027metadata\u0027].get(\u0027finalizers\u0027, [])):"},{"line_number":50,"context_line":"            ns \u003d policy[\u0027metadata\u0027][\u0027namespace\u0027]"},{"line_number":51,"context_line":"            name \u003d policy[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":52,"context_line":"            # FIXME(dulek): This will conflict with anything else that adds"},{"line_number":53,"context_line":"            #               finalizers, we should make sure to fix it. I don\u0027t"},{"line_number":54,"context_line":"            #               see a way to do that using JSON patch, it\u0027s just"},{"line_number":55,"context_line":"            #               too simple."},{"line_number":56,"context_line":"            self.k8s.patch_crd("},{"line_number":57,"context_line":"                \u0027metadata\u0027, f\u0027{k_const.K8S_API_NETWORKING}/namespaces/{ns}/\u0027"},{"line_number":58,"context_line":"                            f\u0027networkpolicies/{name}\u0027,"},{"line_number":59,"context_line":"                {\u0027finalizers\u0027: [k_const.NETWORKPOLICY_FINALIZER]},"},{"line_number":60,"context_line":"                action\u003d\u0027replace\u0027)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        self._drv_policy.ensure_network_policy(policy)"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_010c203f","line":60,"range":{"start_line":47,"start_character":7,"end_line":60,"end_character":33},"updated":"2020-04-28 17:20:12.000000000","message":"Why do we need to add a finalizer to the policy object? shouldn\u0027t it be only on the CRD?","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"0554c5fc25269f6cf20c3ff53c81b2d467edd559","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    def on_present(self, policy):"},{"line_number":45,"context_line":"        LOG.debug(\"Created or updated: %s\", policy)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        # Put finalizer in"},{"line_number":48,"context_line":"        if (k_const.NETWORKPOLICY_FINALIZER not in"},{"line_number":49,"context_line":"                policy[\u0027metadata\u0027].get(\u0027finalizers\u0027, [])):"},{"line_number":50,"context_line":"            ns \u003d policy[\u0027metadata\u0027][\u0027namespace\u0027]"},{"line_number":51,"context_line":"            name \u003d policy[\u0027metadata\u0027][\u0027name\u0027]"},{"line_number":52,"context_line":"            # FIXME(dulek): This will conflict with anything else that adds"},{"line_number":53,"context_line":"            #               finalizers, we should make sure to fix it. I don\u0027t"},{"line_number":54,"context_line":"            #               see a way to do that using JSON patch, it\u0027s just"},{"line_number":55,"context_line":"            #               too simple."},{"line_number":56,"context_line":"            self.k8s.patch_crd("},{"line_number":57,"context_line":"                \u0027metadata\u0027, f\u0027{k_const.K8S_API_NETWORKING}/namespaces/{ns}/\u0027"},{"line_number":58,"context_line":"                            f\u0027networkpolicies/{name}\u0027,"},{"line_number":59,"context_line":"                {\u0027finalizers\u0027: [k_const.NETWORKPOLICY_FINALIZER]},"},{"line_number":60,"context_line":"                action\u003d\u0027replace\u0027)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        self._drv_policy.ensure_network_policy(policy)"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_08487e59","line":60,"range":{"start_line":47,"start_character":7,"end_line":60,"end_character":33},"in_reply_to":"1f493fa4_010c203f","updated":"2020-07-16 14:44:17.000000000","message":"Main advantage is that this way we won\u0027t ever loose delete events.","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"e77f1eb994d5791684c477349d933952339ca6ae","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        LOG.debug(\"Created or updated: %s\", policy)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        # Put finalizer in if it\u0027s not there already."},{"line_number":41,"context_line":"        self.k8s.add_finalizer(policy, k_const.NETWORKPOLICY_FINALIZER)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        self._drv_policy.ensure_network_policy(policy)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def on_finalize(self, policy):"},{"line_number":46,"context_line":"        LOG.debug(\"Finalizing policy %s\", policy)"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_a963d440","line":43,"range":{"start_line":41,"start_character":0,"end_line":43,"end_character":54},"updated":"2020-07-24 11:01:00.000000000","message":"in the other CRD Patch sets, we first create the CR and then add the finalizer. With the order here, if kuryr-controller dies before ejecuting ensure_network_policy, the policy won\u0027t be ever deleted","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"3a569efd34bc752b021e9281b62a0c78141fe758","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        LOG.debug(\"Created or updated: %s\", policy)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        # Put finalizer in if it\u0027s not there already."},{"line_number":41,"context_line":"        self.k8s.add_finalizer(policy, k_const.NETWORKPOLICY_FINALIZER)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        self._drv_policy.ensure_network_policy(policy)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def on_finalize(self, policy):"},{"line_number":46,"context_line":"        LOG.debug(\"Finalizing policy %s\", policy)"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf51134e_fa0d88e8","line":43,"range":{"start_line":41,"start_character":0,"end_line":43,"end_character":54},"in_reply_to":"bf51134e_a963d440","updated":"2020-07-24 13:24:53.000000000","message":"That\u0027s true.","commit_id":"9b4d765b092ee6411c7f80ee398eebd446928584"}],"kuryr_kubernetes/handlers/k8s_base.py":[{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"2631af81d7a031a6755d875348a0b4757f9ab429","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from kuryr_kubernetes.handlers import dispatch"},{"line_number":19,"context_line":"from kuryr_kubernetes.handlers import health"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def object_kind(event):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_4e9f16b4","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":29},"updated":"2020-04-21 08:55:14.000000000","message":"this is not used, right?","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5c020077c1d68df7c8cb0467ecc83dd2d73a1842","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from kuryr_kubernetes.handlers import dispatch"},{"line_number":19,"context_line":"from kuryr_kubernetes.handlers import health"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def object_kind(event):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f493fa4_013b1cd1","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":29},"in_reply_to":"1f493fa4_4e9f16b4","updated":"2020-04-23 15:41:36.000000000","message":"Right!","commit_id":"71e4f9a822f3adf449f4b53852f008b28ee88d54"}],"kuryr_kubernetes/k8s_client.py":[{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"58498df493a7f2912f1ce2259afe5bc4a81dfbc7","unresolved":false,"context_lines":[{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        if action \u003d\u003d \u0027remove\u0027:"},{"line_number":129,"context_line":"            data \u003d [{\u0027op\u0027: action,"},{"line_number":130,"context_line":"                     \u0027path\u0027: f\u0027/{field}\u0027"},{"line_number":131,"context_line":"                             f\u0027/{data}\u0027}]"},{"line_number":132,"context_line":"        else:"},{"line_number":133,"context_line":"            data \u003d [{\u0027op\u0027: action,"},{"line_number":134,"context_line":"                     \u0027path\u0027: f\u0027/{field}/{crd_field}\u0027,"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f560f44_9275c09b","line":131,"range":{"start_line":130,"start_character":0,"end_line":131,"end_character":41},"updated":"2020-07-27 10:22:36.000000000","message":"Why did you split the string?","commit_id":"46def311a0ac2429504db05bb215ef715f68b954"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"9f531620a7d3b74bc838045a1124206ab1d2f5b3","unresolved":false,"context_lines":[{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        if action \u003d\u003d \u0027remove\u0027:"},{"line_number":129,"context_line":"            data \u003d [{\u0027op\u0027: action,"},{"line_number":130,"context_line":"                     \u0027path\u0027: f\u0027/{field}\u0027"},{"line_number":131,"context_line":"                             f\u0027/{data}\u0027}]"},{"line_number":132,"context_line":"        else:"},{"line_number":133,"context_line":"            data \u003d [{\u0027op\u0027: action,"},{"line_number":134,"context_line":"                     \u0027path\u0027: f\u0027/{field}/{crd_field}\u0027,"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f560f44_9294a0ea","line":131,"range":{"start_line":130,"start_character":0,"end_line":131,"end_character":41},"in_reply_to":"9f560f44_9275c09b","updated":"2020-07-27 10:57:46.000000000","message":"No idea, will revert this. ;)","commit_id":"46def311a0ac2429504db05bb215ef715f68b954"}],"kuryr_kubernetes/tests/unit/controller/handlers/test_kuryrnetworkpolicy.py":[{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"58498df493a7f2912f1ce2259afe5bc4a81dfbc7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2018 Red Hat, Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":14,"id":"9f560f44_526328dd","line":1,"range":{"start_line":1,"start_character":12,"end_line":1,"end_character":16},"updated":"2020-07-27 10:22:36.000000000","message":"2020\n\nAlso, I believe, test for KuryrNetworkPolicyHandler is not completed, right?","commit_id":"46def311a0ac2429504db05bb215ef715f68b954"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"9f531620a7d3b74bc838045a1124206ab1d2f5b3","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2018 Red Hat, Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":14,"id":"9f560f44_f284fcb3","line":1,"range":{"start_line":1,"start_character":12,"end_line":1,"end_character":16},"in_reply_to":"9f560f44_526328dd","updated":"2020-07-27 10:57:46.000000000","message":"Yeah, this could use a few more tests for sure and I have that in my backlog. I\u0027m planning to address that in a follow-up patch.","commit_id":"46def311a0ac2429504db05bb215ef715f68b954"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"ee4f22e06c106331c8cfba6578c5baa8dc29198d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2018 Red Hat, Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":14,"id":"9f560f44_452fb6a0","line":1,"range":{"start_line":1,"start_character":12,"end_line":1,"end_character":16},"in_reply_to":"9f560f44_f284fcb3","updated":"2020-07-29 12:18:32.000000000","message":"ack.","commit_id":"46def311a0ac2429504db05bb215ef715f68b954"}]}
