-
Notifications
You must be signed in to change notification settings - Fork 82
Closed
Description
When I try to create a Debian package for "k8s.io/cli-runtime", I get the following output:
# dh-make-golang make -git_revision v0.31.3 -type l k8s.io/cli-runtime
2024/11/26 14:33:52 Starting "dh-make-golang v0.7.0 linux/amd64"
2024/11/26 14:33:52 Downloading "k8s.io/cli-runtime/..."
2024/11/26 14:33:54 Determining upstream version number
2024/11/26 14:33:54 Found latest tag "kubernetes-1.31.3"
2024/11/26 14:33:54 WARNING: Latest tag "kubernetes-1.31.3" is not a valid SemVer version
2024/11/26 14:33:54 Latest tag "kubernetes-1.31.3" matches master
2024/11/26 14:33:54 Package version is "1.31.3"
When I check the upstream repo "k8s.io/cli-runtime", I observe that both tags `kubernetes-1.31.3" and "v0.31.3" refers to the same commit:
$ git branch
* (HEAD detached at v0.31.3)
master
$ git log -1
commit 597e981c50a2b9cc2f484e6fc94f618822b62888 (HEAD, tag: v0.31.3, tag: kubernetes-1.31.3)
Author: Kubernetes Publisher <[email protected]>
Date: Thu Nov 21 05:10:54 2024 +0000
Update dependencies to v0.31.3 tag
`
$ git remote -v
origin https://github.com/kubernetes/cli-runtime.git (fetch)
origin https://github.com/kubernetes/cli-runtime.git (push)
I assume the behavior of "dh-make-golang" is because
- tag
kubernetes-1.31.3
is created at a later time afterv0.31.3
thus making it the latest tag before theHEAD
. - "dh-make-golang" uses "git describe" which fetches the latest tag before the
HEAD
[1] which is checked out to the value specified by option "-git_revision" by "dh-make-golang" [2].
I would hope that, if the git revision specified by "-git_revision" is a valid tag, "dh-make-golang" should be using that tag without any additional heuristics because:
- This, I think, would be more intuitive.
- Otherwise, I would have to manually fix the package version in the templates generated by "dh-make-golang" in this particular case of packaging "v0.31.3" of "k8s.io/cli-runtime".
Reference
[1]
Line 41 in d70d43c
cmd := exec.Command("git", "describe", "--abbrev=0", "--tags", "--exclude", "*/v*") |
[2]
Line 353 in d70d43c
if err := u.get(gopath, repo, revision); err != nil { |
Line 136 in d70d43c
return rr.VCS.CreateAtRev(dir, rr.Repo, rev) |
Metadata
Metadata
Assignees
Labels
No labels