Description of problem: OPM does not have a way to get the compiled commitId or version. That could help correlate issues with a specific version. opm -h 1 ↵ CLI to interact with operator-registry and build indexes of operator content Usage: opm [command] Available Commands: help Help about any command index generate operator index container images registry interact with operator-registry database Flags: -h, --help help for opm Version-Release number of selected component (if applicable): https://github.com/operator-framework/operator-registry commit 2bdcd07e6f9ea23a35f1fdbb6a7c6584ec53a0a1 How reproducible: Always Actual results: OPM does not have a way to track version Expected results: Have a way to get commitId with the binary Additional info:
Now the Makefile has the proper flags. LGTM, thanks. git rev-parse --short HEAD 9994e3e $ git clone git:operator-framework/operator-registry.git $ cd operator-registry/ $ git rev-parse --short HEAD 9994e3e $ make build GOFLAGS="-mod=vendor" go build -o bin/appregistry-server ./cmd/appregistry-server GOFLAGS="-mod=vendor" go build -o bin/configmap-server ./cmd/configmap-server GOFLAGS="-mod=vendor" go build -o bin/initializer ./cmd/initializer GOFLAGS="-mod=vendor" go build -o bin/registry-server ./cmd/registry-server GOFLAGS="-mod=vendor" go build -ldflags "-X 'github.com/operator-framework/operator-registry/cmd/opm/version.gitCommit=9994e3e' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=1.12.3' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2020-05-14T14:39:40Z'" -o bin/opm ./cmd/opm $ ./bin/opm version Version: version.Version{OpmVersion:"1.12.3", GitCommit:"9994e3e", BuildDate:"2020-05-14T14:39:40Z", GoOs:"linux", GoArch:"amd64"}
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2409