Update go 1.22 to use go1.22.1-1-openssl-fips git tag

This commit is contained in:
Ash McKenzie 2024-03-20 08:44:14 +00:00 committed by Stan Hu
parent de37364ba0
commit d9c6c24d4c
3 changed files with 9 additions and 11 deletions

View file

@ -4,7 +4,7 @@ set -xeou pipefail
INSTALL_GOLANG_VERSION=${1}
GOLANG_DOWNLOAD_SHA256=${2}
INSTALL_GOLANG_VERSION_FIPS=${3:-${INSTALL_GOLANG_VERSION}}
INSTALL_GOLANG_FIPS_TAG=${3}
GOLANG_DOWNLOAD_URL="https://golang.org/dl/go${INSTALL_GOLANG_VERSION}.linux-${TARGETARCH:-amd64}.tar.gz"
@ -15,17 +15,15 @@ function build_debian() {
}
function build_ubi() {
GO_MAJOR_VERSION=${INSTALL_GOLANG_VERSION_FIPS%.*}
mkdir -p /tmp/golang
curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz
echo "${GOLANG_DOWNLOAD_SHA256} golang.tar.gz" | sha256sum -c -
tar -C /tmp/golang -xzf golang.tar.gz
# For UBI, we will be installing golang-fips
GO_BRANCH="go${GO_MAJOR_VERSION}-fips-release"
GO_TAG="go${INSTALL_GOLANG_FIPS_TAG}-openssl-fips"
git clone https://github.com/golang-fips/go.git --branch "${GO_BRANCH}" --single-branch --depth 1 /tmp/golang-fips
git clone https://github.com/golang-fips/go.git --branch "${GO_TAG}" --single-branch --depth 1 /tmp/golang-fips
cd /tmp/golang-fips
# The initialize script ends with a commit, so we need to set the user info. And needs to be global due to submodules in use.