Skip to content

Commit 0d9be77

Browse files
Merge pull request #55353 from david-mcmahon/eliminate-version-updates
Automatic merge from submit-queue (batch tested with PRs 55265, 54092, 55353, 53733, 55385). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Capture git export-subst strings in version.sh for 'git archive' use. Eliminate the need to update pkg/version/base.go on release branch tagging. This excellent solution brought to you by @ixdy. - [ ] Cherrypick to release-1.8 - [ ] Cherrypick to release-1.7 - [ ] Cherrypick to release-1.6? - [ ] Update kubernetes/release/anago to skip updating base.go files ref kubernetes/release#459 ref #16815 (somewhat related) cc @javier-b-perez Kubernetes-commit: 4e68d2511ef07428a69a2b6c66efc2b05f4b97dc
2 parents 6951d6e + 415f49f commit 0d9be77

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/version/base.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ var (
5151
// semantic version is a git hash, but the version itself is no
5252
// longer the direct output of "git describe", but a slight
5353
// translation to be semver compliant.
54+
55+
// NOTE: The $Format strings are replaced during 'git archive' thanks to the
56+
// companion .gitattributes file containing 'export-subst' in this same
57+
// directory. See also https://git-scm.com/docs/gitattributes
5458
gitVersion string = "v0.0.0-master+$Format:%h$"
55-
gitCommit string = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD)
56-
gitTreeState string = "not a git tree" // state of git tree, either "clean" or "dirty"
59+
gitCommit string = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD)
60+
gitTreeState string = "" // state of git tree, either "clean" or "dirty"
5761

5862
buildDate string = "1970-01-01T00:00:00Z" // build date in ISO8601 format, output of $(date -u +'%Y-%m-%dT%H:%M:%SZ')
5963
)

0 commit comments

Comments
 (0)