Commit 3b8b9e6a authored by Chen Zhiwei's avatar Chen Zhiwei

Build Kubernetes binaries with valid Semantic Version

parent c817765b
...@@ -96,6 +96,13 @@ kube::version::get_version_vars() { ...@@ -96,6 +96,13 @@ kube::version::get_version_vars() {
KUBE_GIT_MINOR+="+" KUBE_GIT_MINOR+="+"
fi fi
fi fi
# If KUBE_GIT_VERSION is not a valid Semantic Version, then refuse to build.
if ! [[ "${KUBE_GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)(\.[0-9]+)?(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then
echo "KUBE_GIT_VERSION should be a valid Semantic Version"
echo "Please see more details here: https://semver.org"
exit 1
fi
fi fi
fi fi
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment