-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Fix for Add fallback to Static Version File in Shallow Clones. #131630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Hi @sarkar-deb. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sarkar-deb The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
else | ||
KUBE_GIT_VERSION=$("${git[@]}" describe --tags --match='v*' --abbrev=14 "${KUBE_GIT_COMMIT}^{commit}" 2>/dev/null) || true | ||
# Fallback to /build/build-image/cross/VERSION if git describe fails | ||
version_file="${KUBE_ROOT}/build/build-image/cross/VERSION" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold
#131629 (comment)
This is not correct
downstream tooling is responsible to do one of these things:
if our scripts are allowing a build to proceed with KUBE_GIT_VERSION completely unset or invalid, erroring more visibly seems reasonable, but I don't think we need to add new ways of deriving version info in this script... the git tag or manual override of KUBE_GIT_VERSION seems reasonable to me |
@liggitt
@BenTheElder |
There are two approaches today:
I don't think we should add a third way to derive version tags. If we want to try to improve detection of when the repo was not cloned normally build scripts are deriving unexpected git tags and error sooner, that could be ok if it is straightforward and reliable. |
@liggitt , when git has given a way to perform shallow clone, why would we go and fail build rather we can use a way to derive versions and get it moving. Hope I got your comment correctly. |
Doing a shallow clone is perfectly fine, but you are then responsible to provide the missing tag information by setting KUBE_GIT_VERSION. We don't want to add a second way to derive the version, especially since it will not be used by the official Kubernetes release, and will therefore be very likely to atrophy / stop working randomly. |
you're not deriving the version in this PR, please see the comments on the issue linked above #131629 (comment) Also, there are better alternatives to shallow clone (see the comment linked ... #131629 (comment)) |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
When git describe cannot determine the version due to a shallow clone or lack of tags, the current versioning logic does not
provide a meaningful fallback. This can cause downstream tooling and image tagging logic to behave incorrectly or inconsistently.
Now when we build kubelet on this a branch:
After fix
Note: To get version I have used data from file build/build-image/cross/VERSION
For issue:
#131629