Merge pull request #6925 from sh1vam31/fix-ldflags-warning

hack: redirect git tag warnings to stderr
This commit is contained in:
KubeEdge Bot 2026-07-10 14:55:18 +08:00 committed by GitHub
commit 4f6705b91e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -59,10 +59,10 @@ kubeedge::version::get_version_info() {
GIT_VERSION=$(git describe --tags --abbrev=14 "${GIT_COMMIT}^{commit}" 2>/dev/null) GIT_VERSION=$(git describe --tags --abbrev=14 "${GIT_COMMIT}^{commit}" 2>/dev/null)
if [[ -z "${GIT_VERSION}" ]]; then if [[ -z "${GIT_VERSION}" ]]; then
echo echo >&2
echo "⚠️ No git tags found." echo "⚠️ No git tags found." >&2
echo "⚠️ Falling back to default version: v0.0.0" echo "⚠️ Falling back to default version: v0.0.0" >&2
echo "⚠️ To avoid this, consider running: git fetch --tags" echo "⚠️ To avoid this, consider running: git fetch --tags" >&2
GIT_VERSION="v0.0.0" GIT_VERSION="v0.0.0"
fi fi