Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/skipper: fix version and commit for go install (#2954)
When skipper is installed via `go install` it has empty version and commit values: ``` ~$ go install github.com/zalando/skipper/cmd/skipper@latest go: downloading github.com/zalando/skipper v0.21.2 ~$ skipper -version Skipper version (commit: , runtime: go1.22.0) ``` Current build process of binaries specifies version and commit via `-ldflags`. This change uses debug buildinfo to get version and commit if they are not specified by `-ldflags` which is compatible with the current build process but should also work for `go install` case. If this change fixes `go install` case (which can only be tested after package version is published) then we can add the same snippet to other binaries and get rid of COMMIT_HASH ldflag. We can not get rid of `-ldflags` fully though because `go build` does not stamp version (see golang/go#50603). Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
- Loading branch information