Skip to content

Commit

Permalink
Merge pull request #1130 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1128-to-release-4.13

[release-4.13] OCPBUGS-10661: Fix empty component version
  • Loading branch information
openshift-merge-robot committed Mar 28, 2023
2 parents 866531e + 67ab1f6 commit a23baf7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hack/go-build.sh
Expand Up @@ -15,8 +15,13 @@ eval $(go env | grep -e "GOHOSTOS" -e "GOHOSTARCH")
cd "$(git rev-parse --show-cdup)"

if [ -z ${VERSION_OVERRIDE+a} ]; then
echo "Using version from git..."
VERSION_OVERRIDE=$(git describe --abbrev=8 --dirty --always)
if [ -n "${BUILD_VERSION+a}" ] && [ -n "${BUILD_RELEASE+a}" ]; then
echo "Using version from the build system..."
VERSION_OVERRIDE="${BUILD_VERSION}-${BUILD_RELEASE}"
else
echo "Using version from git..."
VERSION_OVERRIDE=$(git describe --abbrev=8 --dirty --always)
fi
fi

GLDFLAGS+="-extldflags '-static' -X ${REPO}/pkg/version.Raw=${VERSION_OVERRIDE}"
Expand Down

0 comments on commit a23baf7

Please sign in to comment.