#1 Fix compile error with k8s.io/apimachinery v1.17
Merged 4 years ago by eclipseo. Opened 4 years ago by olem.

@@ -0,0 +1,12 @@

+ diff -ru cri-1.11.1/pkg/server/streaming.go cri-fix-k8s-io-apimachinery-1-17/pkg/server/streaming.go

+ --- cri-1.11.1/pkg/server/streaming.go	2018-08-09 20:37:54.000000000 +0200

+ +++ cri-fix-k8s-io-apimachinery-1-17/pkg/server/streaming.go	2020-03-21 08:28:43.362630046 +0100

+ @@ -36,7 +36,7 @@

+  

+  func newStreamServer(c *criService, addr, port string) (streaming.Server, error) {

+  	if addr == "" {

+ -		a, err := k8snet.ChooseBindAddress(nil)

+ +		a, err := k8snet.ChooseHostInterface()

+  		if err != nil {

+  			return nil, errors.Wrap(err, "failed to get stream server address")

+  		}

@@ -15,7 +15,7 @@

  %global godocs          docs CONTRIBUTING.md code-of-conduct.md README.md

  

  Name:           %{goname}

- Release:        5%{?dist}

+ Release:        6%{?dist}

  Summary:        Containerd Plugin for Kubernetes Container Runtime Interface

  

  # Upstream license specification: Apache-2.0
@@ -33,6 +33,8 @@

  Patch3:         0001-Replace-stringid-with-simple-rand-reader.patch

  # To use newer opencontainers/selinux

  Patch4:         0001-bump-opencontainers-selinux-to-v1.2.patch

+ # To work with k8s.io/apimachinery 1.17.2 (golang-k8s-apimachinery-devel)

+ Patch5:         0001-Fix-compile-error-with-k8s-io-apimachinery-1-17.patch

  

  BuildRequires:  golang(github.com/containerd/cgroups)

  BuildRequires:  golang(github.com/containerd/containerd)
@@ -160,6 +162,9 @@

  %gopkgfiles

  

  %changelog

+ * Sat Mar 21 2020 Olivier Lemasle <o.lemasle@gmail.com> - 1.11.1-6

+ - Fix compile error with k8s.io/apimachinery 1.17.2 (rhbz#1815736)

+ 

  * Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.1-5

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

  

github.com/containerd/cri in version 1.11.1 depends on an old
version of k8s.io/apimachinery (commit ed135c5b96450fd24e5e981c708114fbbd950697).

This commit makes it compatible with k8s.io/apimachinery 1.17, by replacing
k8s.io/apimachinery/pkg/util/net.ChooseBindAddress(nil) by
k8s.io/apimachinery/pkg/util/net.ChooseHostInterface(), which is what
provided the removed function ChooseBindAddress.

Cf. https://github.com/kubernetes/apimachinery/blob/ed135c5b96450fd24e5e981c708114fbbd950697/pkg/util/net/interface.go#L383

Fix https://bugzilla.redhat.com/show_bug.cgi?id=1815736

Pull-Request has been merged by eclipseo

4 years ago