Fix linux disable network sniffer ansible syntax for non-standard interfaces#14076
Conversation
|
Hi @Hazerre. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
| - name: "{{{ rule_title }}} - Disable promiscuous mode" | ||
| ansible.builtin.command: | ||
| cmd: ip link set dev {{ item.split(':')[1] }} multicast off promisc off | ||
| cmd: ip link set dev {{ (item.split(':')[1] | trim).split('@')[0] }} multicast off promisc off |
There was a problem hiding this comment.
Your change looks good to me. However, I have noticed a suspicious thing that exists below on line 16.
network_interfaces.stdout_lines is defined and "item.split(':') | length == 3"
I think that the double quotes shouldn't be there because they represent a string literal, not a jinja expression.
I think it should be:
network_interfaces.stdout_lines is defined and item.split(':') | length == 3
Can you take a look into this?
There was a problem hiding this comment.
Good catch. I'm not sure why it was like that before or how it was passing tests. Added another commit to resolve that.
Fixed an odd when statement being a string. Not sure why this was like this before or why it passed automated testing. The previous implementation failed my personal testing.
Description:
bond.70@bond0.Rationale:
Fixes #11901
Review Hints:
Existing filters will reduce registered item to only the interface name by extracting the content between two
:delimiters. The enhancements will take the output of that and further reduce the item by extracting the content left of the first@delimiter. This results in thebond.70@bond0becomingbond.70as that is the first item (0) in this delimited list.Example registered item:
3: bond.70@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether ab:cd:ef:12:34:56 brd ff:ff:ff:ff:ff:ff\ altname enxabcdef123456Existing jinja template filter results:
bond.70@bond0Enhanced jinja template filter results:
bond.70Good examples are useful commands, if it is better to review all commits together or in a suggested sequence, any relevant discussion in other PRs or issues, etc.