From b1c95594c5c0678dfdc783d1c520e657b34c8ce4 Mon Sep 17 00:00:00 2001 From: Henry Li <69694695+henryli001@users.noreply.github.com> Date: Wed, 9 Feb 2022 15:05:48 -0800 Subject: [PATCH] [main] Upgrade cni to v1.0.1 (#2167) * update cni * upgrade cni Co-authored-by: Henry Li --- SPECS/cni/build.sh | 8 ++++---- SPECS/cni/cni.signatures.json | 5 +++-- SPECS/cni/cni.spec | 26 ++++++++++++++++++++++++-- cgmanifest.json | 4 ++-- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/SPECS/cni/build.sh b/SPECS/cni/build.sh index f66be45404..024b8d7603 100644 --- a/SPECS/cni/build.sh +++ b/SPECS/cni/build.sh @@ -9,14 +9,14 @@ if [ ! -h gopath/src/${REPO_PATH} ]; then ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255 fi -export GO15VENDOREXPERIMENT=1 +export GO17VENDOREXPERIMENT=1 export GOPATH=${PWD}/gopath echo "Building API" -go build -buildmode=pie "$@" ${REPO_PATH}/libcni +go build -mod vendor -v -buildmode=pie "$@" ${REPO_PATH}/libcni echo "Building reference CLI" -go build -buildmode=pie -o ${PWD}/bin/cnitool "$@" ${REPO_PATH}/cnitool +go build -mod vendor -v -buildmode=pie -o ${PWD}/bin/cnitool "$@" ${REPO_PATH}/cnitool echo "Building plugins" PLUGINS="plugins/test/*" @@ -24,6 +24,6 @@ for d in $PLUGINS; do if [ -d $d ]; then plugin=$(basename $d) echo " " $plugin - go build -buildmode=pie -o ${PWD}/bin/$plugin "$@" ${REPO_PATH}/$d + go build -mod vendor -v -buildmode=pie -o ${PWD}/bin/$plugin "$@" ${REPO_PATH}/$d fi done diff --git a/SPECS/cni/cni.signatures.json b/SPECS/cni/cni.signatures.json index a0790f1f83..2f4a663988 100644 --- a/SPECS/cni/cni.signatures.json +++ b/SPECS/cni/cni.signatures.json @@ -1,7 +1,8 @@ { "Signatures": { "99-loopback.conf": "82e03a3292ca327bcc86af3664a0d7b110cb1c39bca16d3cc703abd49c3c9a1b", - "build.sh": "0626c2cc6371866f489ec1215e48a4192ece3e3019794ba7292e8d637d90eedc", - "cni-0.8.1.tar.gz": "6242e7905b5f8f7561a21f595209b569998727927380a8cdf5ab58e7fd5ac2d5" + "build.sh": "1fc4529fae5bdf52cf6b9e5eb603c7703046f35e76c6c3a525085c63ef55a7ff", + "cni-1.0.1-vendor.tar.gz": "c837529a293115a9d2c7ac59eaf4600c62c7597dd998cf51e851eb5e1016ebf1", + "cni-1.0.1.tar.gz": "0e5376f70fb36c26935ddfb90b0da69736592ba8b577fbfb904750034c053d3b" } } \ No newline at end of file diff --git a/SPECS/cni/cni.spec b/SPECS/cni/cni.spec index 5bd5700254..3887ff9faa 100644 --- a/SPECS/cni/cni.spec +++ b/SPECS/cni/cni.spec @@ -23,8 +23,8 @@ %define __arch_install_post export NO_BRP_STRIP_DEBUG=true Summary: Container Network Interface - networking for Linux containers Name: cni -Version: 0.8.1 -Release: 2%{?dist} +Version: 1.0.1 +Release: 1%{?dist} License: Apache-2.0 Vendor: Microsoft Corporation Distribution: Mariner @@ -34,6 +34,20 @@ URL: https://github.com/containernetworking/cni Source0: %{name}-%{version}.tar.gz Source1: 99-loopback.conf Source2: build.sh +# Below is a manually created tarball, no download link. +# We're using pre-populated Go modules from this tarball, since network is disabled during build time. +# How to re-build this file: +# 1. wget https://github.com/containernetworking/cni/archive/refs/tags/v1.0.1.tar.gz -o %%{name}-%%{version}.tar.gz +# 2. tar -xf %%{name}-%%{version}.tar.gz +# 3. cd %%{name}-%%{version} +# 4. go mod vendor +# 5. tar --sort=name \ +# --mtime="2021-04-26 00:00Z" \ +# --owner=0 --group=0 --numeric-owner \ +# --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \ +# -cf %%{name}-%%{version}-vendor.tar.gz vendor +# +Source3: %{name}-%{version}-vendor.tar.gz BuildRequires: golang BuildRequires: systemd-rpm-macros BuildRequires: xz @@ -55,6 +69,9 @@ range of support and the specification is simple to implement. cp %{SOURCE2} build.sh %build +# create vendor folder from the vendor tarball and set vendor mode +tar -xf %{SOURCE3} --no-same-owner + # go1.16+ default is GO111MODULE=on set to auto temporarily # until using upstream release with go.mod export GO111MODULE=auto @@ -96,6 +113,11 @@ install -m 755 -d "%{buildroot}%{cni_doc_dir}" %{_sbindir}/cnitool %changelog +* Wed Feb 09 2022 Henry Li - 1.0.1-1 +- Upgrade to version 1.0.1 +- Add vendor source, which is required to build +- Modify build.sh to build using vendor source + * Tue Aug 17 2021 Henry Li - 0.8.1-2 - Initial CBL-Mariner import from openSUSE Tumbleweed (license: same as "License" tag). - License Verified diff --git a/cgmanifest.json b/cgmanifest.json index 756f0e377a..64060f5685 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -1987,8 +1987,8 @@ "type": "other", "other": { "name": "cni", - "version": "0.8.1", - "downloadUrl": "https://github.com/containernetworking/cni/archive/refs/tags/v0.8.1.tar.gz" + "version": "1.0.1", + "downloadUrl": "https://github.com/containernetworking/cni/archive/refs/tags/v1.0.1.tar.gz" } } },