From 7684c8e29af090a48d3e66bd36415e216b5d0352 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Mon, 28 Jan 2019 09:22:15 -0600 Subject: [PATCH] snap: use new GOPATH to build image Use a new GOPATH to build image in order to avoid clashes with user's GOPATH, otherwise user's kata agent will be used causing problem if that repository is not up to date. Signed-off-by: Julio Montes --- snap/snapcraft.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index af6e0aaae..66a4bb689 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -123,6 +123,9 @@ parts: - docker.io - cpio override-build: | + # set GOPATH + export GOPATH=$(realpath go) + mkdir -p "${GOPATH}" # go was built in parts/go/build export GOROOT=$(realpath ../../go/build) export PATH="${GOROOT}/bin:${PATH}" @@ -138,7 +141,7 @@ parts: # use the same go version for all packages sed -i 's|^GO_VERSION=.*|GO_VERSION='$(go version | cut -d' ' -f3 | tr -d go)'|g' rootfs-builder/versions.txt - sudo -E PATH=$PATH make DISTRO=alpine AGENT_INIT=yes USE_DOCKER=1 initrd + sudo -E PATH=$PATH make AGENT_VERSION=${SNAPCRAFT_PROJECT_VERSION} DISTRO=alpine AGENT_INIT=yes USE_DOCKER=1 initrd kata_image_dir=${SNAPCRAFT_PART_INSTALL}/usr/share/kata-containers mkdir -p ${kata_image_dir}