15 Commits

Author SHA1 Message Date
Dan Williams
d2e5b5decb portmap: increase test coverage to 1.0.0 and older spec versions
Signed-off-by: Dan Williams <dcbw@redhat.com>
2021-02-15 10:08:24 -06:00
Dan Williams
7d8c767622 plugins: update to spec version 1.0.0
Signed-off-by: Dan Williams <dcbw@redhat.com>
2021-02-11 23:27:08 -06:00
Antonio Ojea
108c2aebd4 portmap plugin should flush previous udp connections
conntrack does not have any way to track UDP connections, so
it relies on timers to delete a connection.
The problem is that UDP is connectionless, so a client will keep
sending traffic despite the server has gone, thus renewing the
conntrack entries.
Pods that use portmaps to expose UDP services need to flush the existing
conntrack entries on the port exposed when they are created,
otherwise conntrack will keep sending the traffic to the previous IP
until the connection age (the client stops sending traffic)

Signed-off-by: Antonio Ojea <aojea@redhat.com>
2020-11-23 16:29:52 +01:00
Federico Paolinelli
8a6e96b3f0 Replace nc with the local echo client.
This makes the behaviour more consistent across platforms.

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
2020-10-07 20:13:24 +02:00
Antonio Ojea
d8b1289098
fix portmap port forward flakiness
Use a Describe container for the It code block of the
portmap port forward integration test.

Signed-off-by: Antonio Ojea <antonio.ojea.garcia@gmail.com>
2019-12-12 09:03:06 +01:00
Casey Callendrello
9fab520c37 Portmap: append, rather than prepend, entry rules
This means that portmapped connections can be more easily controlled /
firewalled.
2019-03-18 14:03:13 -05:00
Michael Cambria
ddbf22f7f9 Vendor github.com/containernetworking/cni libcni and pkg file needed for CHECK
Update plugins/tests to deal with changes made to this vendor'ed code
2018-11-05 16:35:03 -05:00
Casey Callendrello
a0eac8d7d9 pkg/ns: remove namespace creation (and move to testutils)
Namespace creation had an unergonomic interface and isn't used, except
for testing code. Remove it; downstream users should really be creating
their own namespaces
2018-04-03 18:56:25 +02:00
Casey Callendrello
5576f3120e portmap: support hairpin, improve performance
This change improves the performance of the portmap plugin and fixes
hairpin, when a container is mapped back to itself.

Performance is improved by using a multiport test to reduce rule
traversal, and by using a masquerade mark.

Hairpin is fixed by enabling masquerading for hairpin traffic.
2017-11-10 16:56:52 +01:00
Gabriel Rosenhouse
008024125a portmap integration test: echo server runs in separate process
this way we're not mixing goroutines and namespaces
2017-09-05 23:36:12 -07:00
Casey Callendrello
3745ee2d3f plugins/portmap: fix test flake
The source address selection was random, and sometimes we picked a
source address that the container didn't have a route to. Adding a
default route fixes that!
2017-07-06 16:12:24 +02:00
Dan Williams
0da6780449 pkg,plugins: update for Result struct Interface index changes
It's a pointer now, so we need to use the helper function to set
the field and also test for nil before accessing it.
2017-06-29 13:40:36 -05:00
Casey Callendrello
83ec9bb73f portmap: Don't accept a port number of 0
This also adds more testing around configuration parsing.
2017-06-15 14:00:04 +02:00
Casey Callendrello
43a24515ee build: some minor post-repo-split fixes; add fastbuild 2017-06-01 18:51:46 +02:00
Casey Callendrello
a7aaf0e377 plugins/meta/portmap: add an iptables-based host port mapping plugin 2017-06-01 10:06:28 +02:00