CNG: Workhorse does not report actual version
Summary
When checking the version of workhorse, according to the binary within the gitlab-workhorse-*
container, the output reports only the datestamp at which it was built. Version built & distributed with Omnibus report the actual version.
Steps to reproduce
Outputs from charts:
$ kubectl get pods -lapp=unicorn
NAME READY STATUS RESTARTS AGE
maven-unicorn-8bcdb9869-cz75v 2/2 Running 0 5d
maven-unicorn-8bcdb9869-hxprh 2/2 Running 0 5d
$ kubectl exec -ti maven-unicorn-8bcdb9869-hxprh -c gitlab-workhorse -- gitlab-workhorse -version
gitlab-workhorse -20181107.005058
Output from Omnibus:
root@gitlab:~# /opt/gitlab/embedded/bin/gitlab-workhorse -version
gitlab-workhorse v7.0.0-20181019.141754
Current behavior
Reported version of workhorse only includes the datestamp. gitlab-workhorse -20181107.005058
Expected behavior
Reported version of workhorse includes the version and datestamp. gitlab-workhorse v7.0.0-20181019.141754
Versions
- Chart:
master
62ce7dd7 - Container:
gitlab-workhorse-*
@ gitlab-org/build/CNG@f936204f - Platform: N/A
- Kubernetes: N/A
- Helm: N/A
Research
Our gitlab-workhorse/Dockerfile builds the sources from a tarball. This results in part of the version string being missing, but only because we did not build from a git checkout. That sounds odd, but it is because of the Makefile from GitLab Workhorse calling git describe
to build it's VERSION
via non-overridable assignment (:=
), which is then passed directly to go build
as an argument. The Omnibus GitLab builds from git checkout, and thus does not encounter this issue.
To me, we should get the problem defined and fixed upstream.
We can however, get around this issue more immediately by building from git checkout in our Dockerfile.