This caused Jenkins break on e2e-test because the version of server and
client did not match exactly, as the server was built without the
version ldflags.
Tested:
- Ran "release/build-release.sh ${instance_name}" and confirmed that
output/release/master-release/src/saltbase/pillar/common.sls has the
git version under version.gitCommit no longer version.commitFromGit.
Fixes: b777eb19e2
The correct way to reset it to the default would be IFS=$' \t\n', but
there's no reason to assume a wrong setting here, in fact, nothing this
script does should depend on an IFS setting, so let's just drop this
line altogether.
Tested:
- Ran "release/build-release.sh <instance>" before and after this
change. Compared the two trees for differences, only difference was
the SHA1 in output/release/master-release/src/saltbase/pillar/common.sls
$ diff -Naur output.orig/release/master-release/ output/release/master-release/
diff -Naur output.orig/release/master-release/src/saltbase/pillar/common.sls output/release/master-release/src/saltbase/pillar/common.sls
--- output.orig/release/master-release/src/saltbase/pillar/common.sls 2014-08-27 13:28:52.104241577 -0700
+++ output/release/master-release/src/saltbase/pillar/common.sls 2014-08-27 13:29:28.296087806 -0700
@@ -1,2 +1,2 @@
instance_prefix: MY_INSTANCE_NAME-minion
-go_opt: -ldflags "-X github.com/GoogleCloudPlatform/kubernetes/pkg/version.commitFromGit 'e169da2abfbf'"
+go_opt: -ldflags "-X github.com/GoogleCloudPlatform/kubernetes/pkg/version.commitFromGit '8aea0d85e447-dirty'"
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Allows a consumer to get at the information stored in the field selector
for querying an underlying data store. Not generic, but offers a
simple start.
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>
Previously it would only print a version when the tree was dirty. Fix it
so that it will also print one on a clean tree.
Tested:
- Built it from a committed tree:
$ hack/build-go.sh
$ output/go/bin/kubelet -version
Kubernetes version 0.1, build a091590dd10c
Signed-off-by: Filipe Brandenburger <filbranden@google.com>