Repository navigation
Expose build version via redkey_robin_build_info - #74
Merged
Merged
Conversation
Signed-off-by: Alberto Martínez Pérez <albertompe@ext.inditex.com>
DanielDorado
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make Robin report which build is running.
The image build already passed
-ldflags "-X main.version=${VERSION}", butmain.versionwas never declared, so the linker silently ignored it. This PR declaresvar version = "dev"incmd/main.goand exposes the version:redkey_robin_build_infogauge (value1, labelsversionandgo_version), mirroring the operator'sredkey_operator_build_info. It is registered on controller-runtime's registry rather than the resettable one, becauseResettableRegistry.Reset()would drop it.--versionflag: prints the version and exits.User-Agent:redkey-robin/<version>.make buildandmake runinjectVERSIONthroughLDFLAGS.docker-buildanddocker-buildxalready passed it to the Dockerfile. A plaingo buildfalls back todev.The Redis
CLIENT SETNAMEpart of the issue is deferred, becauseCLIENT SETNAMEcan fail for ACL-restricted users.No reconciliation behavior changes.
Closes #45
Additional context
internal/metrics/buildinfo_test.gochecks the gauge value and labels.cmd/main_test.gobuilds the binary with and without-X main.versionand checks the--versionoutput. It is skipped under-short.make lintandmake testpass.make test-integrationmake build && bin/robin --versionprints0.2.0;go build ./cmd/printsdev.