mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 13:12:20 +00:00
Add additional ldflags constants for Kubernetes versioning
Now it is possible to push these variables through ldflags: - gitMajor - gitMinor - gitVersion (from latest annotated tag, output of git describe) - gitCommit (renamed commitFromGit, intended to have the full sha1) - gitTreeState (either "clean" or "dirty") These are spawned into its separate source file, since they are meant to be updated separately when a new version is released. Also use the notation vX.Y+ for when git information is not present. (This is consistent with the kernel build, e.g. Linux 3.15+ means its version is >= 3.15 and < 3.16.) v2: Added comments to the individual fields in pkg/version/base.go Tested: - Built it and checked the -version output: $ hack/build-go.sh $ output/go/bin/kubelet -version Kubernetes version 0.1+, build c328679ef8aa Signed-off-by: Filipe Brandenburger <filbranden@google.com>
This commit is contained in:
@@ -45,4 +45,4 @@ done
|
||||
# our cluster deploy. If we add more command line options to our standard build
|
||||
# we'll want to duplicate them there. As we move to distributing pre- built
|
||||
# binaries we can eliminate this duplication.
|
||||
go install -ldflags "-X github.com/GoogleCloudPlatform/kubernetes/pkg/version.commitFromGit '${version}'" "${binaries[@]}"
|
||||
go install -ldflags "-X github.com/GoogleCloudPlatform/kubernetes/pkg/version.gitCommit '${version}'" "${binaries[@]}"
|
||||
|
Reference in New Issue
Block a user