mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 21:25:09 +00:00
Add git branch to make build short hash unique
KUBE_ROOT_HASH depends just on the host name and directory path. So when working with branches, it could lead to some confusion since the hash is the same even when you switch from branch to branch. Let us use the git branch information when we compute the short hash Fixes #1801
This commit is contained in:
@@ -178,7 +178,8 @@ function kube::build::verify_prereqs() {
|
||||
fi
|
||||
fi
|
||||
|
||||
KUBE_ROOT_HASH=$(kube::build::short_hash "${HOSTNAME:-}:${KUBE_ROOT}")
|
||||
KUBE_GIT_BRANCH=$(git symbolic-ref --short -q HEAD 2>/dev/null || true)
|
||||
KUBE_ROOT_HASH=$(kube::build::short_hash "${HOSTNAME:-}:${KUBE_ROOT}:${KUBE_GIT_BRANCH}")
|
||||
KUBE_BUILD_IMAGE_TAG_BASE="build-${KUBE_ROOT_HASH}"
|
||||
KUBE_BUILD_IMAGE_TAG="${KUBE_BUILD_IMAGE_TAG_BASE}-${KUBE_BUILD_IMAGE_VERSION}"
|
||||
KUBE_BUILD_IMAGE="${KUBE_BUILD_IMAGE_REPO}:${KUBE_BUILD_IMAGE_TAG}"
|
||||
|
Reference in New Issue
Block a user