Conversation
|
This PR stacks with #1997 |
| } | ||
|
|
||
| // Helper function to find all MSS values in Exists calls | ||
| func findMSSInExistsCalls(calls []struct { |
There was a problem hiding this comment.
Are findMSSInExistsCalls and findMSSInAppendCalls meant to be identical? If yes, should they be consolidated into one helper func instead?
There was a problem hiding this comment.
Good catch! I'll update to a single call!
|
|
||
| err := nsc.setupMangleTableRule("10.0.0.1", "tcp", "8080", "1234") | ||
|
|
||
| assert.Error(t, err, "Expected error when FWMARK OUTPUT AppendUnique fails") |
There was a problem hiding this comment.
Nit (feel free to ignore) - I think https://pkg.go.dev/github.com/stretchr/testify@v1.11.1/assert#ErrorContains does both of these assertions in 1
There was a problem hiding this comment.
No, this is also good feedback, I'll make the change! 🙂
| // setupMangleTableRule Error Handling Tests | ||
| // ============================================================================= | ||
|
|
||
| func TestSetupMangleTableRule_ErrorHandling_FWMarkPreRoutingFails(t *testing.T) { |
There was a problem hiding this comment.
I think all of the setupMangleTableRule tests all have a very similar structure that loans itself well to table driven tests. It might help with making these easier to read if they're grouped that way.
There was a problem hiding this comment.
Absolutely agree. I'll fix em! Thanks for the recommendation!
ac2f7f3 to
667b7c3
Compare
|
@catherinetcai this should be ready for you to take another look now. |
This adds testing for TCPMSS configurations and ensures backwards compatibility and that old rules are removed when upgrading kube-router versions.
This also fixes a minor bug introduced in #1996 when @rkojedzinszky fixed up IPv6 MSS values for us, by cleaning up any old incorrect IPv6 mangle values that might still be around if someone did an in-place upgrade of kube-router.