Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1024 from chavafg/topic/1.9-backport-yq
Browse files Browse the repository at this point in the history
backport: tools: use yq 2.3.0 for stable-1.9
  • Loading branch information
chavafg authored Apr 20, 2020
2 parents b0f23c4 + b9bc278 commit 28a9010
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ install_yq() {
[ -x "${GOPATH}/bin/yq" ] && return

get_kata_arch
local goos="$(uname -s)"
goarch=$("${kata_arch_sh}" -g)

mkdir -p "${GOPATH}/bin"

# Workaround to get latest release from github (to not use github token).
# Get the redirection to latest release on github.
yq_latest_url=$(curl -Ls -o /dev/null -w %{url_effective} "https://${yq_pkg}/releases/latest")
# The redirected url should include the latest release version
# https://github.com/mikefarah/yq/releases/tag/<VERSION-HERE>
yq_version=$(basename "${yq_latest_url}")

local yq_url="https://${yq_pkg}/releases/download/${yq_version}/yq_linux_${goarch}"
# Stick to a specific version. Same used in
# runtime and osbuilder repos.
yq_version=2.3.0

## NOTE: ${var,,} => gives lowercase value of var
local yq_url="https://${yq_pkg}/releases/download/${yq_version}/yq_${goos,,}_${goarch}"

curl -o "${yq_path}" -L "${yq_url}"
chmod +x "${yq_path}"
}
Expand Down

0 comments on commit 28a9010

Please sign in to comment.