mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
vendor updates
This commit is contained in:
15
vendor/k8s.io/kubernetes/hack/lib/version.sh
generated
vendored
15
vendor/k8s.io/kubernetes/hack/lib/version.sh
generated
vendored
@ -62,7 +62,7 @@ kube::version::get_version_vars() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# Use git describe to find the version based on annotated tags.
|
||||
# Use git describe to find the version based on tags.
|
||||
if [[ -n ${KUBE_GIT_VERSION-} ]] || KUBE_GIT_VERSION=$("${git[@]}" describe --tags --abbrev=14 "${KUBE_GIT_COMMIT}^{commit}" 2>/dev/null); then
|
||||
# This translates the "git describe" to an actual semver.org
|
||||
# compatible semantic version that looks something like this:
|
||||
@ -89,13 +89,20 @@ kube::version::get_version_vars() {
|
||||
# Try to match the "git describe" output to a regex to try to extract
|
||||
# the "major" and "minor" versions and whether this is the exact tagged
|
||||
# version or whether the tree is between two tagged versions.
|
||||
if [[ "${KUBE_GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)(\.[0-9]+)?([-].*)?$ ]]; then
|
||||
if [[ "${KUBE_GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)(\.[0-9]+)?([-].*)?([+].*)?$ ]]; then
|
||||
KUBE_GIT_MAJOR=${BASH_REMATCH[1]}
|
||||
KUBE_GIT_MINOR=${BASH_REMATCH[2]}
|
||||
if [[ -n "${BASH_REMATCH[4]}" ]]; then
|
||||
KUBE_GIT_MINOR+="+"
|
||||
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
|
||||
}
|
||||
@ -133,8 +140,8 @@ kube::version::ldflag() {
|
||||
local val=${2}
|
||||
|
||||
# If you update these, also update the list pkg/version/def.bzl.
|
||||
echo "-X ${KUBE_GO_PACKAGE}/pkg/version.${key}=${val}"
|
||||
echo "-X ${KUBE_GO_PACKAGE}/vendor/k8s.io/client-go/pkg/version.${key}=${val}"
|
||||
echo "-X '${KUBE_GO_PACKAGE}/pkg/version.${key}=${val}'"
|
||||
echo "-X '${KUBE_GO_PACKAGE}/vendor/k8s.io/client-go/pkg/version.${key}=${val}'"
|
||||
}
|
||||
|
||||
# Prints the value that needs to be passed to the -ldflags parameter of go build
|
||||
|
Reference in New Issue
Block a user