diff --git a/kubernetes/cni/plugins/centos/build_srpm.data b/kubernetes/cni/plugins/centos/build_srpm.data index 5414e0582..dab75dc8b 100644 --- a/kubernetes/cni/plugins/centos/build_srpm.data +++ b/kubernetes/cni/plugins/centos/build_srpm.data @@ -1,2 +1,2 @@ -COPY_LIST="${CGCS_BASE}/downloads/containernetworking-plugins-v1.0.1.tar.gz" +COPY_LIST="${CGCS_BASE}/downloads/containernetworking-plugins-v1.0.1.tar.gz ${FILES_BASE}/*" TIS_PATCH_VER=PKG_GITREVCOUNT diff --git a/kubernetes/cni/plugins/centos/containernetworking-plugins.spec b/kubernetes/cni/plugins/centos/containernetworking-plugins.spec index 486084d61..900f551a2 100644 --- a/kubernetes/cni/plugins/centos/containernetworking-plugins.spec +++ b/kubernetes/cni/plugins/centos/containernetworking-plugins.spec @@ -31,6 +31,8 @@ URL: https://%{provider_prefix} Source0: %{project}-%{repo}-v%{version}.tar.gz ExclusiveArch: aarch64 %{arm} ppc64le s390x x86_64 %{ix86} +Patch0001: 0001-Allow-setting-sysctls-on-a-particular-interface.patch + %if 0%{?fedora} BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} %else @@ -51,7 +53,8 @@ when the container is deleted. %{?enable_gotoolset110} %prep -%autosetup -n %{project}-%{repo}-v%{version} +%setup -q -n %{project}-%{repo}-v%{version} +%patch0001 -p1 rm -rf plugins/main/windows %build @@ -123,6 +126,9 @@ install -p -m 0755 bin/* %{buildroot}/var/opt/cni/bin /var/opt/cni/bin/* %changelog +* Mon Jun 27 2022 Steven Webster +- tuning: Support for IFNAME key + * Mon Jun 06 2022 Dan Voiculeasa - Update install directory to /var/opt/cni/bin. diff --git a/kubernetes/cni/plugins/centos/files/0001-Allow-setting-sysctls-on-a-particular-interface.patch b/kubernetes/cni/plugins/centos/files/0001-Allow-setting-sysctls-on-a-particular-interface.patch new file mode 100644 index 000000000..bd46bbf6f --- /dev/null +++ b/kubernetes/cni/plugins/centos/files/0001-Allow-setting-sysctls-on-a-particular-interface.patch @@ -0,0 +1,32 @@ +From c16cff9805427c5db34b43de3155769b362f596e Mon Sep 17 00:00:00 2001 +From: Piotr Skamruk +Date: Fri, 1 Oct 2021 18:07:50 +0200 +Subject: [PATCH] Allow setting sysctls on a particular interface + +Signed-off-by: Piotr Skamruk +[ commit c16cff9805427c5db34b43de3155769b362f596e + in upstream repo https://github.com/containernetworking/plugins ] +Signed-off-by: Steven Webster +--- + plugins/meta/tuning/tuning.go | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/plugins/meta/tuning/tuning.go b/plugins/meta/tuning/tuning.go +index 7b56944..d9eef83 100644 +--- a/plugins/meta/tuning/tuning.go ++++ b/plugins/meta/tuning/tuning.go +@@ -325,6 +325,11 @@ func cmdAdd(args *skel.CmdArgs) error { + + err = ns.WithNetNSPath(args.Netns, func(_ ns.NetNS) error { + for key, value := range tuningConf.SysCtl { ++ // If the key contains `IFNAME` - substitute it with args.IfName ++ // to allow setting sysctls on a particular interface, on which ++ // other operations (like mac/mtu setting) are performed ++ key = strings.Replace(key, "IFNAME", args.IfName, 1) ++ + fileName := filepath.Join("/proc/sys", strings.Replace(key, ".", "/", -1)) + fileName = filepath.Clean(fileName) + +-- +2.29.2 + diff --git a/kubernetes/cni/plugins/debian/patches/0001-Allow-setting-sysctls-on-a-particular-interface.patch b/kubernetes/cni/plugins/debian/patches/0001-Allow-setting-sysctls-on-a-particular-interface.patch new file mode 100644 index 000000000..bd46bbf6f --- /dev/null +++ b/kubernetes/cni/plugins/debian/patches/0001-Allow-setting-sysctls-on-a-particular-interface.patch @@ -0,0 +1,32 @@ +From c16cff9805427c5db34b43de3155769b362f596e Mon Sep 17 00:00:00 2001 +From: Piotr Skamruk +Date: Fri, 1 Oct 2021 18:07:50 +0200 +Subject: [PATCH] Allow setting sysctls on a particular interface + +Signed-off-by: Piotr Skamruk +[ commit c16cff9805427c5db34b43de3155769b362f596e + in upstream repo https://github.com/containernetworking/plugins ] +Signed-off-by: Steven Webster +--- + plugins/meta/tuning/tuning.go | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/plugins/meta/tuning/tuning.go b/plugins/meta/tuning/tuning.go +index 7b56944..d9eef83 100644 +--- a/plugins/meta/tuning/tuning.go ++++ b/plugins/meta/tuning/tuning.go +@@ -325,6 +325,11 @@ func cmdAdd(args *skel.CmdArgs) error { + + err = ns.WithNetNSPath(args.Netns, func(_ ns.NetNS) error { + for key, value := range tuningConf.SysCtl { ++ // If the key contains `IFNAME` - substitute it with args.IfName ++ // to allow setting sysctls on a particular interface, on which ++ // other operations (like mac/mtu setting) are performed ++ key = strings.Replace(key, "IFNAME", args.IfName, 1) ++ + fileName := filepath.Join("/proc/sys", strings.Replace(key, ".", "/", -1)) + fileName = filepath.Clean(fileName) + +-- +2.29.2 + diff --git a/kubernetes/cni/plugins/debian/patches/series b/kubernetes/cni/plugins/debian/patches/series new file mode 100644 index 000000000..ae712c033 --- /dev/null +++ b/kubernetes/cni/plugins/debian/patches/series @@ -0,0 +1 @@ +0001-Allow-setting-sysctls-on-a-particular-interface.patch