On Tue, Aug 13, 2019 at 3:52 AM Chen Qi <[email protected]> wrote:
> This version is proved to work well for simple k8s flannel setup. > > Nope. We have no reason to use version locked recipes for this. I want one version for the layer, not a _git and a versioned set of plugins. Upgrade the main _cni plugin to the latest version, make sure it works with kubernetes and that's the version we'll use. Cheers, Bruce > Signed-off-by: Chen Qi <[email protected]> > --- > recipes-networking/cni/cni_0.7.1.bb | 79 +++++++++++++++++++++++++++++ > 1 file changed, 79 insertions(+) > create mode 100644 recipes-networking/cni/cni_0.7.1.bb > > diff --git a/recipes-networking/cni/cni_0.7.1.bb b/recipes-networking/cni/ > cni_0.7.1.bb > new file mode 100644 > index 0000000..7a3b87f > --- /dev/null > +++ b/recipes-networking/cni/cni_0.7.1.bb > @@ -0,0 +1,79 @@ > +HOMEPAGE = "https://github.com/containernetworking/cni" > +SUMMARY = "Container Network Interface - networking for Linux containers" > +DESCRIPTION = "CNI (Container Network Interface), a Cloud Native > Computing \ > +Foundation project, consists of a specification and libraries for writing > \ > +plugins to configure network interfaces in Linux containers, along with a > \ > +number of supported plugins. CNI concerns itself only with network > connectivity \ > +of containers and removing allocated resources when the container is > deleted. \ > +Because of this focus, CNI has a wide range of support and the > specification \ > +is simple to implement. \ > +" > + > +# 0.7.1 > +SRCREV_cni = "4cfb7b568922a3c79a23e438dc52fe537fc9687e" > +# 0.7.5 > +SRCREV_plugins = "a62711a5da7a2dc2eb93eac47e103738ad923fd6" > +SRC_URI = "\ > + git:// > github.com/containernetworking/cni.git;branch=master;name=cni \ > + git:// > github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins > \ > + " > + > +RPROVIDES_${PN} += "kubernetes-cni" > + > +LICENSE = "Apache-2.0" > +LIC_FILES_CHKSUM = > "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" > + > +GO_IMPORT = "import" > + > +PV = "0.7.1" > + > +inherit go > +inherit goarch > + > +do_compile() { > + # link fixups for compilation > + rm -f ${S}/src/import/vendor/src > + mkdir -p ${S}/src/import/vendor/ > + ln -sf ./ ${S}/src/import/vendor/src > + rm -rf ${S}/src/import/plugins > + rm -rf ${S}/src/import/vendor/ > github.com/containernetworking/plugins > + > + mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni > + > + ln -sf ../../../../libcni ${S}/src/import/vendor/ > github.com/containernetworking/cni/libcni > + ln -sf ../../../../pkg ${S}/src/import/vendor/ > github.com/containernetworking/cni/pkg > + ln -sf ../../../../cnitool ${S}/src/import/vendor/ > github.com/containernetworking/cni/cnitool > + ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/ > github.com/containernetworking/plugins > + > + export > GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" > + export CGO_ENABLED="1" > + > + cd ${S}/src/import/vendor/ > github.com/containernetworking/cni/libcni > + ${GO} build > + > + cd ${S}/src/import/vendor/ > github.com/containernetworking/cni/cnitool > + ${GO} build > + > + cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ > + PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d > plugins/main/* | grep -v windows)" > + mkdir -p ${WORKDIR}/plugins/bin/ > + for p in $PLUGINS; do > + plugin="$(basename "$p")" > + echo "building: $p" > + ${GO} build -o ${WORKDIR}/plugins/bin/$plugin > github.com/containernetworking/plugins/$p > + done > +} > + > +do_install() { > + localbindir="/opt/cni/bin" > + > + install -d ${D}${localbindir} > + install -d ${D}/${sysconfdir}/cni/net.d > + > + install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} > + install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} > +} > + > +FILES_${PN} += "/opt/cni/bin/*" > + > +INSANE_SKIP_${PN} += "ldflags already-stripped" > -- > 2.17.1 > > -- > _______________________________________________ > meta-virtualization mailing list > [email protected] > https://lists.yoctoproject.org/listinfo/meta-virtualization > -- - Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
-- _______________________________________________ meta-virtualization mailing list [email protected] https://lists.yoctoproject.org/listinfo/meta-virtualization
