Skip to content

Commit

Permalink
snap: use new GOPATH to build image
Browse files Browse the repository at this point in the history
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 <julio.montes@intel.com>
  • Loading branch information
Julio Montes authored and Eric Ernst committed Feb 1, 2019
1 parent 51f5c22 commit 7e312f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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}
Expand Down

0 comments on commit 7e312f8

Please sign in to comment.