1803 Commits

Author SHA1 Message Date
Casey Callendrello
ac8673105a
Merge pull request #743 from arista-eosplus/dummy-plugin
dummy: Create a Dummy CNI plugin that creates a virtual interface.
2022-10-10 17:51:00 +02:00
Dan Williams
fcf14d39fd
Merge pull request #769 from jingyuanliang/main
host-local: remove unused Release(ip) from type Store interface
2022-09-19 10:55:33 -05:00
Dan Williams
54f69e0a59
Merge pull request #768 from EmilyShepherd/cleanup-socket-on-exit
Cleanup Socket and Pidfile on exit
2022-09-12 10:34:39 -05:00
Jingyuan Liang
87c3643d3c host-local: remove unused Release(ip) from type Store interface
Signed-off-by: Jingyuan Liang <jingyuanliang@google.com>
2022-09-06 21:39:54 +00:00
Emily Shepherd
f89a005740
Cleanup Socket and Pidfile on exit
These were previously left intact, even when exiting gracefully. As the
daemon also fails if the socket already exists, it became the caller's
responsibilityto check for and cleanup old socket files when performing
graceful / deliberate restarts.

Signed-off-by: Emily Shepherd <emily@redcoat.dev>
2022-09-06 15:11:57 +01:00
Mircea Iordache-Sica
7fcf8e4860 dummy: Create a Dummy CNI plugin that creates a virtual interface.
Leverages the Linux dummy interface type to create network interfaces
that permists routing packets through the Linux kernel without
them being transmitted.

This solution allows use of arbitrary non-loopback IP addresses within
the container.

Related to #466

Signed-off-by: Mircea Iordache-Sica <mircea@arista.com>
2022-08-11 13:50:37 +01:00
Dan Williams
8c3664b2b1
Merge pull request #742 from lx1036/patch-1
bridge: update vlanFiltering variable to make code more readable
2022-07-28 09:13:29 -05:00
Dan Williams
e2a71387ab
Merge pull request #755 from akhilles/fix/dhcp-renew-hostname
Use the same options for acquiring, renewing lease
2022-07-27 10:37:31 -05:00
Akhil Velagapudi
c78e1e4656
Use the same options for acquiring, renewing lease
Currently, hostname is set in the original DHCPREQUEST but not the
renewal. With some DHCP server implementations (such as FreeBSD dhcpd),
this leads to the hostname being cleared in the lease table.

This behavior is inconsistent with other DHCP clients such as dhclient
which set the hostname on the renewal request as well. To fix, use the
same options for acquire and renew.

This is compatible with RFC 2131 (see table 5).

Signed-off-by: Akhil Velagapudi <4@4khil.com>
2022-06-23 17:47:37 -07:00
Xiang Liu
9f4090dabf bridge: update vlanFiltering variable to make code more readable
Signed-off-by: Xiang Liu <lx1036@126.com>
2022-05-21 14:37:36 +08:00
Dan Williams
9c59728d39
Merge pull request #730 from mmirecki/tuning_duplicate_check
Check for duplicated sysctl keys
2022-05-04 11:21:35 -05:00
Dan Williams
6a94696205
Merge pull request #712 from mesosphere/joe/add_error_output
bug: return errors when iptables and ip6tables are unusable
2022-05-04 11:01:41 -05:00
Dan Williams
356db54531
Merge pull request #740 from jpsim/patch-1
ci: only rerun failed jobs on `/retest`
2022-05-04 11:00:26 -05:00
Casey Callendrello
f7dfa0f600
Merge pull request #739 from AkihiroSuda/riscv64
build: support riscv64
2022-05-04 17:44:44 +02:00
JP Simard
f1aa6c2622
ci: only rerun failed jobs on /retest
Unlike `rerun_url`, this endpoint isn't in the run API response,
but we can construct it manually easily.

Documentation for it is here:
https://docs.github.com/en/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run

Signed-off-by: JP Simard <jp@jpsim.com>
2022-04-28 22:13:02 -04:00
Akihiro Suda
bf4068e1cd
build: support riscv64
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-04-29 01:53:59 +09:00
mmirecki
7c452c77cd Check for duplicated sysctl keys
Signed-off-by: mmirecki <mmirecki@redhat.com>
2022-04-27 22:13:17 +02:00
Dan Williams
6264f7bff9
Merge pull request #735 from martinetd/crash-LTE
Update github.com/vishvananda/netlink to v1.2.0-beta
2022-04-27 11:02:30 -05:00
Dan Williams
6bcc877722
Merge pull request #732 from squeed/go-1.18
Bump to go 1.18
2022-04-27 10:59:28 -05:00
Casey Callendrello
9114aa6d37
Merge pull request #733 from Kern--/bridge-ipam-dns
bridge: support IPAM DNS settings
2022-04-27 17:59:06 +02:00
Dominique Martinet
f891722833 Update github.com/vishvananda/netlink to v1.2.0-beta
Latest version fixes a segfault when used on some ppp setup

Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
2022-04-27 10:58:34 +09:00
Kern Walster
a70e87c3aa bridge: support IPAM DNS settings
Previously, the bridge plugin ignored DNS settings returned
from an IPAM plugin (e.g. the host-local plugin parsing
resolv.conf to configure DNS). With this change, the bridge plugin
uses IPAM DNS settings.

Similarly to #388, this change will use incoming DNS settings if set,
otherwise IPAM plugin returned DNS settings

Signed-off-by: Kern Walster <walster@amazon.com>
2022-04-21 05:12:01 +00:00
Casey Callendrello
0a0853a756 Bump to go 1.18
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2022-04-20 18:06:58 +02:00
Dan Williams
0c39335765
Merge pull request #725 from selansen/v2api-suuport-win-overlay
V2 API support for win-overlay CNI
2022-04-14 13:13:37 -05:00
selansen
8b8825bcd8 V2 API support for win-overlay CNI
This PR bring V2 API support into win-overlay CNI. With the current V1
API, only docker runtime works for win-overlay. By bringing new changes, we
should be able to use containerd as the runtime.Below are the key
points regarding this implementation.
	1. Clear seperation for V1 & V2 API support
	2. New cni.conf sample that works for win-overlay

Signed-off-by: selansen <esiva@redhat.com>
Signed-off-by: mansikulkarni96 <mankulka@redhat.com>
2022-04-14 12:44:49 -04:00
Dan Williams
93604ec20a
Merge pull request #724 from squeed/stale-keep
github: ignore issues with "keep" label from stale closing
2022-04-13 11:14:47 -05:00
Joe Julian
e3d563b0f0
bug: return errors when iptables and ip6tables are unusable
Signed-off-by: Joe Julian <me@joejulian.name>
2022-04-01 11:03:54 -07:00
Casey Callendrello
16e4a82b32
Merge pull request #719 from benmcmahon100/patch-1
Make description for `static` plugin more exact
2022-03-30 18:03:34 +02:00
Casey Callendrello
e952f16c75 github: ignore issues with "keep" label from stale closing
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2022-03-30 18:02:45 +02:00
Ben McMahon
5ad4fcf85a
Make description for static plugin more exact
Signed-off-by: Ben McMahon <benmcmahon100@gmail.com>
2022-03-18 23:18:57 +00:00
Casey Callendrello
292f188e4e
Merge pull request #717 from squeed/auto-close-stale
workflow: add something to auto-close stale PRs
2022-03-16 16:58:48 +01:00
Casey Callendrello
57c1cb5058 workflow: add something to auto-close stale PRs
Signed-off-by: Casey Callendrello <cdc@redhat.com>
2022-03-09 18:05:17 +01:00
Dan Williams
b8a10bbe11
Merge pull request #702 from gojoy/master
call ipam.ExecDel after clean up device in netns
2022-03-02 10:50:25 -06:00
Casey Callendrello
600c58a54f
Merge pull request #709 from fwiesel/ipam_dhcp_client_id
ipam/dhcp: Fix client id in renew/release
2022-03-02 17:49:12 +01:00
Casey Callendrello
3512b10ff0
Merge pull request #693 from mmirecki/POC_sysctl_whitelist
Add sysctl allowList
2022-03-02 17:40:46 +01:00
Fabian Wiesel
7a98979487 ipam/dhcp: Fix client id in renew/release
The client id was constructed differently in the acquire
function compared to the release and renew functions,
which caused the dhcp-server to consider it a different client.
This is now encapsulated in a common function.

Signed-off-by: Fabian Wiesel <fabian.wiesel@sap.com>
2022-02-27 22:19:50 +01:00
gojoy
7aa07efe29 call ipam.ExceDel after clean up device in netns
fix #666

Signed-off-by: gojoy <729324352@qq.com>
2022-02-27 10:55:42 +08:00
mmirecki
96c3af81e2 Add sysctl allowlist
Signed-off-by: mmirecki <mmirecki@redhat.com>
2022-02-24 15:41:04 +01:00
Casey Callendrello
26745d3752
Merge pull request #705 from devbv/master
portmap: fix bug that new udp connection deletes all existing conntrack entries
v1.1.0
2022-02-23 17:55:23 +01:00
Casey Callendrello
9f67faf00f
Merge pull request #707 from danwinship/checkPorts
portmap: fix checkPorts result when chain does not exist
2022-02-23 17:46:33 +01:00
Dan Winship
08d0f33416 portmap: fix checkPorts result when chain does not exist
checkPorts would return nil rather than an error if the per-container
DNAT chain didn't exist, meaning CHECK would erroneously return
success rather than failure.

chain.check() already (correctly) checks that the chain exists, so
there's no need to do it separately before calling that anyway.

Signed-off-by: Dan Winship <danwinship@redhat.com>
2022-02-21 12:33:14 -05:00
Sang Heon Lee
dca23ad451 portmap: fix bug that new udp connection deletes all existing conntrack entries
Calling AddPort before AddProtocol returns an error, which means ConntrackDeleteFilter has been called without port filter.

Signed-off-by: Sang Heon Lee <developistBV@gmail.com>
2022-02-19 14:34:43 +09:00
Dan Williams
76307bf0f6
Merge pull request #695 from MikeZappa87/issue/680/explicitdaddisable
Explicitly Disable Duplicate Address Detection For Container Side Veth
2022-02-09 11:42:14 -06:00
Michael Zappa
ba47b49609 Enhanced dad set to 1
Signed-off-by: Michael Zappa <Michael.Zappa@stateless.net>
2022-02-09 10:29:57 -07:00
Michael Zappa
2be2960897 Add boolean to enable/disable dad
Signed-off-by: Michael Zappa <Michael.Zappa@stateless.net>
2022-02-09 10:29:57 -07:00
Michael Zappa
8ede7eed87 Disable DAD for container side veth
Signed-off-by: Michael Zappa <Michael.Zappa@stateless.net>
2022-02-09 10:29:57 -07:00
Casey Callendrello
42268a4a93
Merge pull request #584 from AkihiroSuda/isolation-firewall
firewall: support ingressPolicy=(open|same-bridge) for isolating bridges as in Docker
2022-02-09 18:04:22 +01:00
Akihiro Suda
22dd6c553d
firewall: support ingressPolicy=(open|same-bridge) for isolating bridges as in Docker
This commit adds a new parameter `ingressPolicy` (`string`) to the `firewall` plugin.
The supported values are `open` and `same-bridge`.

- `open` is the default and does NOP.

- `same-bridge` creates "CNI-ISOLATION-STAGE-1" and "CNI-ISOLATION-STAGE-2"
that are similar to Docker libnetwork's "DOCKER-ISOLATION-STAGE-1" and
"DOCKER-ISOLATION-STAGE-2" rules.

e.g., when `ns1` and `ns2` are connected to bridge `cni1`, and `ns3` is
connected to bridge `cni2`, the `same-bridge` ingress policy disallows
communications between `ns1` and `ns3`, while allowing communications
between `ns1` and `ns2`.

Please refer to the comment lines in `ingresspolicy.go` for the actual iptables rules.

The `same-bridge` ingress policy is expected to be used in conjunction
with `bridge` plugin. May not work as expected with other "main" plugins.

It should be also noted that the `same-bridge` ingress policy executes
raw `iptables` commands directly, even when the `backend` is set to `firewalld`.
We could potentially use the "direct" API of firewalld [1] to execute
iptables via firewalld, but it doesn't seem to have a clear benefit over just directly
executing raw iptables commands.
(Anyway, we have been already executing raw iptables commands in the `portmap` plugin)

[1] https://firewalld.org/documentation/direct/options.html

This commit replaces the `isolation` plugin proposal (issue 573, PR 574).
The design of `ingressPolicy` was discussed in the comments of the withdrawn PR 574 ,
but `same-network` was renamed to `same-bridge` then.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-02-03 15:49:43 +09:00
Casey Callendrello
f531419b53
Merge pull request #692 from tklauser/x-sys-unix-const
pkg/ns: use file system magic numbers from golang.org/x/sys/unix
2022-01-26 18:26:03 +01:00
Casey Callendrello
5a4ecc5402
Merge pull request #679 from dpward/host-device-up
host-device: Bring interfaces up after moving into container
2022-01-26 18:20:56 +01:00