k3s/pkg/version
Filipe Brandenburger b777eb19e2 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>
2014-08-27 10:06:22 -07:00
..
flag Extract "pkg/version".PrintAndExitIfRequested() to its own package 2014-08-01 15:05:27 +09:00
base.go Add additional ldflags constants for Kubernetes versioning 2014-08-27 10:06:22 -07:00
doc.go update version package when building. 2014-07-02 15:32:30 -07:00
version.go Add additional ldflags constants for Kubernetes versioning 2014-08-27 10:06:22 -07:00