1803 Commits

Author SHA1 Message Date
Chris Randles
354def76b4 vlan: fix error message text by removing ptp references
Signed-off-by: Chris Randles <randles.chris@gmail.com>
2021-01-12 10:02:40 -05:00
toby lorne
25fc741e37 dhcp: daemon dhcp client timeout is configurable
Fixes #470

Signed-off-by: toby lorne <toby@toby.codes>
2021-01-11 22:13:54 +00:00
toby lorne
3161bb52e0 dhcp: timeout value is set in DHCP daemon
Eventually the timeout value will become a CLI argument

The default timeout was nestled all the way in the lease constructor

This commit is the first step in making the timeout configurable by
moving it to the DHCPLease constructor

Signed-off-by: toby lorne <toby@toby.codes>
2021-01-11 22:13:54 +00:00
Bryan Boreham
48a97a7ad1
Merge pull request #564 from yuzhiquan/remove-unused-func
Remove unused function
2021-01-11 10:38:01 +00:00
yuzhiquan
ebce6d0b9b remove unused function
Signed-off-by: yuzhiquan <yuzhiquanlong@gmail.com>
2021-01-11 11:12:00 +08:00
Bryan Boreham
3819ef7e86
Merge pull request #563 from tlwr/main
deps: bump coreos/go-iptables
2021-01-07 11:13:24 +00:00
toby lorne
691238ca57 deps: go mod tidy coreos/go-iptables
Signed-off-by: toby lorne <toby@toby.codes>
2021-01-06 16:13:33 +00:00
toby lorne
23a1d90e0b deps: bump coreos/go-iptables
Closes #544

The above issue describes a situation where using the bridge plugin
with IPv6 addresses prevented `DEL` from working correctly.

`DEL` seems to be failing in the body of `TeardownIPMasq`

This arises because:

* twice delete postrouting rules: `ipn.String()` `ipn.IP.String()` #279
* we are using a version of go-iptables which is bugged for v6

PR github.com/coreos/go-iptables/pull/74 describes why this does
not work. The error message is not being checked correctly.

Using a later version of go-iptables means that
* when the second `ipt.Delete` fails (this is okay)
* we will correctly interpret this as an non-fatal error
* `TeardownIPMasq` will not prematurely exit the method
* `ipt.ClearChain` now can run
* `ipt.DeleteChain` now can run

This explains why this was working for v4 but not v6

This commit was amended to include v0.5.0 instead of a pseudo-version
v0.4.6-0.20200318170312-12696f5c9108

Signed-off-by: toby lorne <toby@toby.codes>
2021-01-05 19:28:14 +00:00
Patryk Strusiewicz-Surmacki
e13bab99e5
tuning: revert values on delete (#540)
Values changed by Tuning plugin should be changed only for pod, therefore should be reverted when NIC is being moved from pod back to host.

Fixes: #493

Signed-off-by: Patryk Strusiewicz-Surmacki <patrykx.strusiewicz-surmacki@intel.com>
v0.9.0
2020-12-09 18:16:52 +01:00
Casey Callendrello
3689d53adf
Merge pull request #557 from squeed/go-1.15
Go 1.15
2020-12-09 18:15:52 +01:00
Casey Callendrello
680c6dd0b1 go mod tidy
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2020-12-09 17:59:56 +01:00
Casey Callendrello
be19d786a0 bump to go 1.15
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2020-12-09 17:59:33 +01:00
Dan Williams
001abd4f55
Merge pull request #555 from squeed/gh-actions
Add github build & test actions, disable travis.
2020-12-09 10:55:58 -06:00
Casey Callendrello
8d52c42f90 Add ability to trigger retests via comments
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2020-12-09 17:46:29 +01:00
Casey Callendrello
3ae85c1093 pkg/ns: fix test case to tolerate pids going away.
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2020-12-09 17:46:29 +01:00
Casey Callendrello
25704f9372 Add github build & test actions
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2020-12-09 17:46:25 +01:00
Dan Williams
7e59bac059
Merge pull request #556 from dcbw/fix-bridge-v6ll-test
bridge: fix testcase to check addresses we care about
2020-12-09 10:25:46 -06:00
Dan Williams
eb31403ac7 bridge: fix testcase to check addresses we care about
Instead of checking the total number of addresses, which might vary
depending on the IPv6 Privacy Address settings of the distro being
used, just check that we have the number of non-link-local addresses
we expect.

Signed-off-by: Dan Williams <dcbw@redhat.com>
2020-12-09 09:36:37 -06:00
Casey Callendrello
336ba52542 Remove travis.
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2020-12-08 16:34:24 +01:00
Casey Callendrello
b47d178ae0 vendor: bump ginkgo, gover
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2020-12-08 16:33:10 +01:00
Casey Callendrello
509d645ee9
Merge pull request #553 from aojea/conntrack
Delete stale UDP conntrack entries when adding new Portmaps to containers
2020-11-25 17:09:43 +01: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
Nate W
cccf5395e8
Updating plugin README.md files (#549)
Removing content and pointing at the new website as a part of the CNI Documentation migration.

Signed-off-by: Nate W <4453979+nate-double-u@users.noreply.github.com>
2020-11-18 17:38:45 +01:00
Antonio Ojea
c41c78b600 update netlink dependencies
Signed-off-by: Antonio Ojea <aojea@redhat.com>
2020-11-17 23:32:35 +01:00
Casey Callendrello
8aad9739d8
Merge pull request #536 from fedepaol/customtable
VRF CNI: Add an optional table parameter.
2020-11-11 17:57:54 +01:00
Casey Callendrello
b7af044cdc
Merge pull request #546 from fedepaol/vrffixsupporter
VRF: extend supported version to 0.3.1 too
2020-11-11 17:55:36 +01:00
Dan Williams
95248d8490
Merge pull request #551 from xieyanker/patch-1
dhcp: fix example configuration
2020-11-11 10:52:14 -06:00
xieyanker
50a3aa6536 Xdhcp: fix example configuration
The current cni config has an extra comma and cannot be parsed normally, the kubelet will report an error as follows:
"Error loading CNI config file: error parsing configuration: invalid character '}' looking for beginning of object key string"

Signed-off-by: xieyanker <xjsisnice@gmail.com>
2020-11-10 07:48:36 +00:00
Federico Paolinelli
98c621abe6 VRF: extend supported version to 0.3.1 too.
The e2e tests already covers both versions, and since the plugin is
meant to be used in chains, this will augment the scope of the plugins
it can be used with.

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
2020-11-03 13:09:03 +01:00
Federico Paolinelli
b34402abd3 VRF CNI: Add an optional table parameter.
When specified from the user, the VRF will get assigned to the given
tableid instead of having the CNI to choose for a free one.

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
2020-11-03 10:43:27 +01:00
Bryan Boreham
ccd872bd7a
Merge pull request #535 from fedepaol/vrfmoretests
VRF CNI: Additional tests
2020-10-28 15:34:55 +00:00
Federico Paolinelli
5fc309a699 Add more tests for the vrf cni plugin.
The new tests expand coverage, checking deletion, ip address handling,
0.4.0 compatibility, behaviour in case of multiple vrfs.

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
2020-10-21 17:59:01 +02:00
Casey Callendrello
440dcc331b
Merge pull request #525 from fedepaol/initialvrf
Introduce a new VRF CNI meta plugin (also bump netlink package to v1.1.0)
2020-10-21 17:49:09 +02:00
Federico Paolinelli
362f5d626a Update github.com/vishvananda/netlink to v1.1.0
Latest version allows to set a VRF device as master and not only
a bridge one.

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
2020-10-14 17:40:50 +02:00
Federico Paolinelli
8d0d8a9547 Introduce a new VRF CNI meta plugin.
This plugin allows to create a VRF with the given name (or use the existing
one if any) in the target namespace, and to allocate the interface
to it.
VRFs make it possible to use multiple routing tables on the same namespace and
allows isolation among interfaces within the same namespace. On top of that, this
allow different interfaces to have overlapping CIDRs (or even addresses).

This is only useful in addition to other plugins.

The configuration is pretty simple and looks like:

{
    "type": "vrf",
    "vrfname": "blue"
}

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
2020-10-14 17:40:50 +02:00
Casey Callendrello
a9abbaf19b
Merge pull request #526 from fedepaol/bumpubuntu
Bump up ubuntu CI ubuntu version to bionic
2020-10-14 17:35:58 +02:00
Dan Williams
c4b8bccd2a
Merge pull request #539 from squeed/arm-tests
Travis: run tests on arm64
2020-10-14 10:32:09 -05:00
Casey Callendrello
1a7f1bd8b1 Travis: run tests on arm64
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2020-10-12 17:14:44 +02: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
Casey Callendrello
6df03d7937
Merge pull request #532 from dverbeir/flannel_ipam_routes
flannel: allow input ipam parameters as basis for delegate
2020-10-07 17:55:41 +02:00
Bryan Boreham
e1517e2498
Merge pull request #534 from s1061123/dev/add-default-ipvlan
ipvlan: make master config as optional
2020-10-07 16:29:56 +01:00
Federico Paolinelli
322790226b Add an echo client to be used instead of nc.
nc behaviour depends on the implementation version of what's on the current host.
Here we use our own client with stable behaviour.

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
2020-10-02 15:56:27 +02:00
Federico Paolinelli
59baaa1546 Bump up the ubuntu version used in CI to bionic.
VRF support was introduced in ubuntu bionic, while it's missing in Xenial.

This also introduces a change in the behaviour of nc command.
On one hand, it requires a new line to send the buffer on the other side,
on the other it hangs waiting for new input.

To address this, a timeout was introduced to avoid the tests to hang,
plus the buffer sent is terminated with a new line character.

Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
2020-10-02 14:50:50 +02:00
David Verbeiren
9ce99d3f07 flannel: allow input ipam parameters as basis for delegate
This change allows providing an 'ipam' section as part of the
input network configuration for flannel. It is then used as
basis to construct the ipam parameters provided to the delegate.

All parameters from the input ipam are preserved except:
* 'subnet' which is set to the flannel host subnet
* 'routes' which is complemented by a route to the flannel
  network.

One use case of this feature is to allow adding back the routes
to the cluster services and/or to the hosts (HostPort) when
using isDefaultGateway=false. In that case, the bridge plugin
does not install a default route and, as a result, only pod-to-pod
connectivity would be available.

Example:
    {
      "name": "cbr0",
      "cniVersion": "0.3.1",
      "type": "flannel",
      "ipam": {
        "routes": [
          {
            "dst": "192.168.242.0/24"
          },
          {
            "dst": "10.96.0.0/12"
          }
        ],
        "unknown-param": "value"
      },
      "delegate": {
        "hairpinMode": true,
        "isDefaultGateway": false
      }
      ...
    }

This results in the following 'ipam' being provided to the delegate:
    {
      "routes" : [
        {
          "dst": "192.168.242.0/24"
        },
        {
          "dst": "10.96.0.0/12"
        },
        {
          "dst" : "10.1.0.0/16"
        }
      ],
      "subnet" : "10.1.17.0/24",
      "type" : "host-local"
      "unknown-param": "value"
    }

where "10.1.0.0/16" is the flannel network and "10.1.17.0/24" is
the host flannel subnet.

Note that this also allows setting a different ipam 'type' than
"host-local".

Signed-off-by: David Verbeiren <david.verbeiren@tessares.net>
2020-09-28 17:15:52 +02:00
Bryan Boreham
e78e6aa5b9
Merge pull request #529 from containernetworking/fix-windows-ginko
Remove extraneous test file in Windows plugin
2020-09-16 16:27:32 +01:00
Tomofumi Hayashi
08ff3b6413 ipvlan: make master config as optional
This change makes ipvlan master parameter optional.
Default to default route interface as macvlan does.

Signed-off-by: Tomofumi Hayashi <tohayash@redhat.com>
2020-09-16 22:05:42 +09:00
Bryan Boreham
1ea19f9213 Remove extraneous test file in Windows plugin
We already have a function to run all tests in the package, in netconf_suite_windows_test.go

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2020-09-09 16:12:54 +00:00
Dan Williams
9b8de6a613
Merge pull request #449 from mars1024/bugfix/flannel_clean
flannel: remove net conf file after DEL succeed
v0.8.7
2020-08-26 10:47:58 -05:00
Casey Callendrello
dacb671328
Merge pull request #523 from tnqn/ns-race
Fix race condition in GetCurrentNS
2020-08-26 17:41:51 +02:00
Quan Tian
799d3cbf4c Fix race condition in GetCurrentNS
In GetCurrentNS, If there is a context-switch between
getCurrentThreadNetNSPath and GetNS, another goroutine may execute in
the original thread and change its network namespace, then the original
goroutine would get the updated network namespace, which could lead to
unexpected behavior, especially when GetCurrentNS is used to get the
host network namespace in netNS.Do.

The added test has a chance to reproduce it with "-count=50".

The patch fixes it by locking the thread in GetCurrentNS.

Signed-off-by: Quan Tian <qtian@vmware.com>
2020-08-21 13:05:21 +08:00