Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
ci: Initialize GOPATH before it's used
Browse files Browse the repository at this point in the history
the GOPATH variable is used by some variables before it gets
initialized. Reorder the logic to work properly.

Fixes: #5713

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
  • Loading branch information
ldoktor committed Jul 25, 2023
1 parent 09de49e commit d32ca2d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .ci/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
# SPDX-License-Identifier: Apache-2.0
#

# Ensure GOPATH set
if command -v go > /dev/null; then
export GOPATH=${GOPATH:-$(go env GOPATH)}
else
# if go isn't installed, set default location for GOPATH
export GOPATH="${GOPATH:-$HOME/go}"
fi

export KATA_KSM_THROTTLER=${KATA_KSM_THROTTLER:-no}
export KATA_QEMU_DESTDIR=${KATA_QEMU_DESTDIR:-"/usr"}
export KATA_ETC_CONFIG_PATH="/etc/kata-containers/configuration.toml"
Expand Down Expand Up @@ -33,14 +41,6 @@ export KATA_NET_TIMEOUT=30

source /etc/os-release || source /usr/lib/os-release

# Ensure GOPATH set
if command -v go > /dev/null; then
export GOPATH=${GOPATH:-$(go env GOPATH)}
else
# if go isn't installed, set default location for GOPATH
export GOPATH="${GOPATH:-$HOME/go}"
fi

# Support Golang 1.16.x.
# By default in Golang >= 1.16 GO111MODULE is set to "on",
# some subprojects in this repo may not support "go modules",
Expand Down

0 comments on commit d32ca2d

Please sign in to comment.