-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add random_fully and rpfilter support #892
Conversation
6ae7879
to
fb3a3d0
Compare
| @@ -492,6 +494,8 @@ def self.rule_to_hash(line, table, counter) | |||
| values.sub(%r{\s-f(?!l)(?=.*--comment)}, ' -f true') | |||
| elsif resource_map[bool].eql?(%r{'--physdev-is-\S+'}) | |||
| values.sub(%r{'#{resource_map[bool]} "! "'}, "#{resource_map[bool]} true") | |||
| elsif bool == :random | |||
| values.sub(%r{'#{resource_map[bool]}(\s|$)'}, "#{resource_map[bool]} true") | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the failing tests it looks like this needs to incorporate the same logic for negation that the else case handles.
| values.sub(%r{'#{resource_map[bool]}(\s|$)'}, "#{resource_map[bool]} true") | |
| values.sub(%r{'#{resource_map[bool]}(\s|$)(?!"!"))'}, "#{resource_map[bool]} true") |
8e892f9
to
642deae
Compare
|
The current set of changes are working on my RHEL7 systems running Kubernetes with Calico without generating errors or warnings. Should I add a new type property for |
|
Rules from calico that were breaking this module: |
|
I didn't realize this was still marked [WIP]. @treydock what is left before this is ready for review? |
|
@rcythr I removed WIP, I don't think there is anything left except maybe to find out if I should also add a property to handle |
|
@treydock Hey, taking a look at your PR I'm mostly happy with just two small comments. Firstly I'm not sure that I like the inclusion of |
536f75b
to
2cb9200
Compare
5dfcc82
to
23bfd65
Compare
|
@david22swan Looking closer the initial change of adding |
|
@treydock Thanks for adding the rpmfilter property. For the acceptance test could you also add some coverage for random-fully as it's the main feature of this pr? |
|
@david22swan The random-fully requires Kernel >= 3.13. Since this is the kernel and not the OS in docker I don't know that the travis environment would have this newer kernel. |
|
Saw this in travis output: |
|
I don't think any of the containers used in the current tests are new enough to support This is using litmus EL7 container and got same error with Ubuntu 18.04 container This is the rule from Kubernetes on RHEL8 that caused problems that prompted this PR: |
|
In that case could you add the test to the exceptions tests and put an exclusion around it so that it only targets Rhel/CentOS 8, that way it will at least get ran on our release test's for now. I've cloned down your changes locally and they look to work fine on both though I didn't dig too deep. |
|
I am running into an issue where this is not resulting in When I added |
|
Given a quick look, it may have something to do with this piece of code,
It's doing a fix to allow for boolean values, including random |
|
I thought that block of code was only used by |
|
True, but it may be related and is something that look's as if it should be included regardless. Just a thought. |
5cff043
to
ea12d1d
Compare
|
I found the problem, I had not properly setup to |
|
@david22swan Any more changes needed? |
|
Apologies but we are currently getting some failures on the module itself and they will need to be fixed before we can merge your work. |
|
@david22swan Would it be possible to re-run the failed tests? They timed out with no errors of failures so I'm not sure what actually failed or if it was some transient problem. |
|
I think the issue in Travis was transient. I just ran |
|
@treydock The failed test's were caused by a ruby version issue in our travis file that has since been updated. |
|
@david22swan I've rebased and tests now pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you for your work :)
|
@david22swan How does the release timeline work for this project? Would it be possible to tag a new release version of this project soon? Sorry for bringing this thread back from the dead, but this is the change I'm desperate to pull down sooner rather than later. |
|
@rcythr For modules we usually release once the amount of changes have hit a tipping point, enough time has passed by or on direct request. Since you pinged about this I'll pass it along and a release should be made soon. |
This is the rule from Kubernetes that was breaking the iptables-save parsing:
This was the full error: